Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querying scheduled task on remote server

Status
Not open for further replies.

EdRev

Programmer
Aug 29, 2000
510
US
I am trying to query the Scheduled task on a remote server and I am not getting any result set.
I know for sure that we have a handful of task scheduled on that server (Server2).


WshShell.Run "Cmd.exe /c schtasks /query /S Server2 /v /nh /fo csv >> " & FileFromName

I tried the following without success:

WshShell.Run "Cmd.exe /c schtasks /query /Server2 /v /nh /fo csv >> " & FileFromName
WshShell.Run "Cmd.exe /c schtasks /query Server2 /v /nh /fo csv >> " & FileFromName

This gives me result on task scheduled on the local server.

WshShell.Run "Cmd.exe /c schtasks /query /v /nh /fo csv >> " & FileFromName

Any help will be greatly appreciated.
 
BTW,

I am running this on an asp page.
Also, I run this on command line and it worked:

schtasks /query /s Server2 /v /nh /fo csv

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top