I need to execute a file on a remote machine without logging into the machine. I created scheduled task for the same. PFB the code snippet
scheduled_task = "schtasks /Create /S <> /SC nologon /TN install /TR c:\Temp\msgbox1.vbs /ST " & Hour(now) & ":" & Minute(now)+1 & ":00 /Z" cmdprmpt = "cmd /c " & scheduled_task intReturnCode= oWshShell.Run (cmdprmpt,4,True)
However this code executes only when the user is logged on. Is there a way to execute the same whether the user is logged on or not. -- This can be done manually in Task Scheduler. Can this be automated?