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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outputting Scheduled Task of a Remote Server

Status
Not open for further replies.

malaygal

IS-IT--Management
Feb 22, 2006
192
US
I have an ASP page that is trying to output scheduled task of a remote server

WshShell.Run "Cmd.exe /c schtasks /query /v /s Server2 /fo csv >> C:\Program Files\Scheduled Tasks\Server2\Task.csv"

1. I believe my target file is invalid because of the spaces in file name. Anyway I can resolve the spaces without using DOS short names
- for testing, I output the result to C:\TestTask.csv
2. I have at least 12 scheduled tasks and the query returned no records (empty output file not even the header)
- for testing I run this (schtasks /query /v /s Server2 /fo csv >> C:\TestTask.csv) on the command prompt and records were returned
- again, for testing, I replaced the remote server name with the host server name (Server1) on the asp page and it worked.
- Somehow the ASP page cannot configure Server2
3. After I resolve 1 and 2, I need to output result to the page. The csv file contains 28 columns and incudes all scheduled task (including Disabled Task).
How do I query the csv file and only output specific columns and only tasked that are not disabled?

Any help will be greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top