Jump to content
Sign in to follow this  
BYTE-ME

[SOLVED] Confirming Tasks Were Scheduled to be Installed by WPI

Recommended Posts

I'm using the batch file at the end of this post in WPI to install tasks to Windows 8 task scheduler. In Windows 7 I could confirm the install worked by making WPI query the Windows 7 task scheduler folder. But Windows 8 no longer stores the tasks in a hidden folder. In addition, the command line "SCHTASKS /Query",  which is suppose to display all scheduled tasks, does not display the one's I've imported, even after they are run by the PC. Anybody got a workaround so I can reliably use the WPI dependency function?

@echo offCOLOR 1aECHO.echo Importing Tasks for Windows Tash SchedulerC:\Windows\System32\timeout.exe /T 2 /NOBREAKCLSCOLOR 1aecho.echo DATA SYNC NETWORK *****************C:\Windows\System32\schtasks.exe /create /TN "DATASYNC NETWORK" /XML "F:\WPI\Install\Task\SM\DATASYNC NET.xml"C:\Windows\System32\timeout.exe /T 2 echo SCAN Malware *****************C:\Windows\System32\schtasks.exe /create /TN "SCAN Malware" /XML "F:\WPI\Install\Task\SMG\SCAN MALWARE.xml"C:\Windows\System32\timeout.exe /T 2 echo SAVE INCREMENTAL IMAGE TO NETWORK *****************C:\Windows\System32\schtasks.exe /create /TN "IFW LOCAL SGA" /XML "F:\WPI\Install\Task\SMG\IFW INCREMENT.xml"C:\Windows\System32\timeout.exe /T 2 echo BACKUP REGISTRY *****************C:\Windows\System32\schtasks.exe /create /TN "REG BACKUP" /XML "F:\WPI\Install\Task\SMG\REGBACK.xml"C:\Windows\System32\timeout.exe /T 2 echo.cls
Edited by BYTE-ME

Share this post


Link to post
Share on other sites

Instead of using XML cant you go 100% CMD?

I set a task to shutdown my PC if I fall asleep and leave it on (but I use autounattend.xml,) this is the code I use

schtasks /create /sc DAILY /tn "Power Off" /tr "shutdown /s /t 60 /c \"Your PC will shutdown in aproximately 1 minute.\"" /st 03:00 /f

Share this post


Link to post
Share on other sites

@Kelsenellenelvian. Those .xml files don't really show up anywhere in the system directory. They are obviously added somewhere but I can't determine where.

@ricktendo. I'm trying to add several individual pre-configured tasks after a clean install, without a reboot, and test that they were successfully copied. I just can't find the flag, whether .dat file, registry change or .xml file, that indicates the tasks were copied successfully. But thanks guys, I'll keep at it.

Share this post


Link to post
Share on other sites

There's a cryptic file in %appdata%\Roaming\Microsoft\MMC\   called "taskschd" with no extension that appears to track new tasks. But I don't think it changes unless Task Scheduler actually runs.

 

In addition, the batch file itself indicates success after each xml file copy. I just need a way to automatically transfer that success flag to WPI so I can grey out the check box and know that the task was done.

Edited by BYTE-ME

Share this post


Link to post
Share on other sites

Found it!

New tasks are entered into the registry under the "TaskCache\Tree". (Then look for the name of the key of one of the tasks you imported)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\
Edited by BYTE-ME

Share this post


Link to post
Share on other sites

@BYTE-ME:  I edited the topic title to clarify what you were trying to accomplish.  Please edit it again and mark it [sOLVED] when you are satisfied that it is.

 

Cheers and Regards

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...