BYTE-ME Posted August 14, 2013 Posted August 14, 2013 (edited) 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 September 2, 2013 by BYTE-ME Quote
Kelsenellenelvian Posted August 14, 2013 Posted August 14, 2013 Since you're crating files can you not just have it look for the file to ensure it's existence? Quote
ricktendo Posted August 14, 2013 Posted August 14, 2013 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 Quote
BYTE-ME Posted August 15, 2013 Author Posted August 15, 2013 @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. Quote
Kelsenellenelvian Posted August 15, 2013 Posted August 15, 2013 There are a couple of features in the newest release that theoretically might work lemme research Quote
BYTE-ME Posted August 16, 2013 Author Posted August 16, 2013 (edited) 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 August 16, 2013 by BYTE-ME Quote
BYTE-ME Posted August 28, 2013 Author Posted August 28, 2013 (edited) 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 November 12, 2013 by BYTE-ME Quote
bphlpt Posted August 29, 2013 Posted August 29, 2013 Entered there means the task was scheduled, not completed, correct? Cheers and Regards Quote
BYTE-ME Posted August 30, 2013 Author Posted August 30, 2013 @bphlpt. Yes, I think that's right. The new registry entries showed up after I created the tasks but before I actually ran them. Quote
bphlpt Posted August 30, 2013 Posted August 30, 2013 @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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.