Windows Scheduled Startup Task doesn't appear to be fully working but why?
I originally tried to use Group Policy to enforce a startup script to run at startup. My startup script is a .CMD file, which calls 10 .exe files. Using Group Policy I could never get this to work....so I looked into using Scheduled Tasks. And here I am. I have tried two different versions of my script (for syntax purposes). I originally thought my syntax could be bad, so I tried a few approaches. Neither work. My #1 .CMD file approach commands look similar to this: start "this is my title" /D "C:\Somepathhere\myExecutable.exe" "..\..\published\wc_task.wfc" My #2 .CMD file approach commands look similar to this (it invokes a shortcut file): rundll32 shell32.dll,ShellExec_RunDLL "C:\Somepathhere\bin\Virtual Workflow.lnk" ^ Both of these scripts work fine ***if I manually run them,*** either by running the .CMD file, or even by manually forcing the Schedule Task MSC console to "Run" this script. Manual process seems to work fine, but automated it does not. My scheduled task is set for startup and uses "highest privileges" to execute as Admin. At the end of my .CMD script, I added a line to write to a text file, just to prove that the script was being run. That command looks like this: echo foo > C:\foo.txt When I reboot my server, and Schedule Tasks kicks in, **I never get my ten .EXE files to run, but I do get the C:\foo.txt on my drive.** What gives?loves to eat meat.
March 16th, 2011 1:53pm

1. You will obtain more information if you hide you functions into batch file like this one (This is example from my system - file is erased) @echo off echo %date% %time% %username% >> g:\in\test2.txt erase /q g:\in\nt336.txt 1>>g:\in\test2.txt 2>>&1 echo %date% %time% >> g:\in\test2.txt 2. What are your other settings (on demand, hidden,....)? Regards Milos
Free Windows Admin Tool Kit Click here and download it now
March 16th, 2011 3:14pm

I have tried two separate .CMD/batch files. Both perform the same end result that I want. Here is one version of my batch file: rundll32 shell32.dll,ShellExec_RunDLL "C:\MyCompany\bin\Administrative Workflow.lnk" rundll32 shell32.dll,ShellExec_RunDLL "C:\MyCompany\bin\DatabaseQueueProcessor.lnk" rundll32 shell32.dll,ShellExec_RunDLL "C:\MyCompany\bin\DigitalInformation Workflow.lnk" rundll32 shell32.dll,ShellExec_RunDLL "C:\MyCompany\bin\Ecofriendly Workflow.lnk" rundll32 shell32.dll,ShellExec_RunDLL "C:\MyCompany\bin\Logging Workflow.lnk" rundll32 shell32.dll,ShellExec_RunDLL "C:\MyCompany\bin\MyHardwareProvider Workflow.lnk" rundll32 shell32.dll,ShellExec_RunDLL "C:\MyCompany\bin\SequentrialSystems Workflow.lnk" rundll32 shell32.dll,ShellExec_RunDLL "C:\MyCompany\bin\SmartPlatforms Workflow.lnk" rundll32 shell32.dll,ShellExec_RunDLL "C:\MyCompany\bin\Virtual Hardware Workflow.lnk" echo foo > C:\foo.txt Here is an alternate version of the same script: start "WorkflowProcessor starting..." /D "C:\MyCompany\Publish\WXP_Admin" "WorkflowProcessor.exe" "..\..\config\MyCompany_admin.wfc" > C:\foo.txt start "DatabaseQueueProcessor starting..." /D "C:\MyCompany\Publish\DBQ" "DatabaseQueueProcessor.exe" "..\..\config\dbqueuehandler.dbq" start "DigitalInformation WorkflowProcessor starting..." /D "C:\MyCompany\Publish\WP_Digi" "WorkflowProcessor.exe" "..\..\config\digitalinformation.wfc" start "Ecofriendly WorkflowProcessor starting..." /D "C:\MyCompany\Publish\WP_Ecobee" "WorkflowProcessor.exe" "..\..\config\Ecofriendly.wfc start "Logging WorkflowProcessor starting..." /D "C:\MyCompany\Publish\WP_Log" "WorkflowProcessor.exe" "..\..\config\Logging.wfc" start "MyHardwareProvider WorkflowProcessor starting..." /D "C:\MyCompany\Publish\WP_Powermand" "WorkflowProcessor.exe" "..\..\config\MyHardwareVendor.wfc" start "SequentrialSystems WorkflowProcessor starting..." /D "C:\MyCompany\Publish\WP_Sequentric" "WorkflowProcessor.exe" "..\..\config\SequentrialSystems.wfc" start "SmartPlatforms WorkflowProcessor starting..." /D "C:\MyCompany\Publish\WP_SmartOES" "WorkflowProcessor.exe" "..\..\config\smartPlatform.wfc" start "Virtual WorkflowProcessor starting..." /D "C:\MyCompany\Publish\WP_Virtual" "WorkflowProcessor.exe" "..\..\config\virtual Hardware.wfc" echo foo > C:\foo.txt Both scripts perform the same end result. Both work when I execute them manually. They will not work completely as a Scheduled Task. When I run it as a scheduled task, all I get is "C:\foo.txt" but none of my exe's are running like they should be. I am not sure what you mean in regards to #2. Settings on what? Hidden? On Demand? I am lost....loves to eat meat.
March 16th, 2011 3:52pm

I have just realized,that 1. What is your server operating system? W2K3(R2) or W2K8(R2) family? 2. Do you need interactive or hidden process(es)? If you try the batch file in W2K3 server from command prompt by issuing at 12:26 /interactive "c:\batch_files\my_task.cmd" then the task is executed with SYSTEM account in interactive mode. 3. In Windows 2008 R2 I use the Scheduler from Server Manager. There is a couple of parameters that control the execution of task. You can troubleshoot the task execution/failure by inspecting history. When using START, consider adding other parameters, see START /? 4. My guess is that you are running your "jobs" with different user rights than you expected. Try something more common to evaluate your procedure. Regards Milos
Free Windows Admin Tool Kit Click here and download it now
March 17th, 2011 3:10am

Milos, 1.) I am using Windows 2K8 server family. 2.) I need interactive processes. I setup a Group Policy startup script. In my CMD/script, I simply call notepad like this: rundll32 shell32.dll,ShellExec_RunDLL "C:\Windows\System32\notepad.exe" echo foo > C:\foo.txt When I restart my server, and login...I can find the file C:\foo.txt, but I do not see Notepad running. If I open Task Manager, I see Notepad.exe running under the SYSTEM account. How can I make Notepad (or any EXE) interactive for the SYSTEM account? Any ideas? Cheers and thank you for your help....loves to eat meat.
April 15th, 2011 6:50pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics