Custom Search

Friday, February 12, 2010

how to create and run schedule task through vbscript and QTP

strJobDelete = "SCHTASKS /Delete /TN ""TaskName"" /F"
strJob = "schtasks /create /sc once /ru NetworkUsername(if u are in network) /rp Network Password /tn ""TaskName"" /tr ""filepath"" /st "time

Dim oShell
Set oShell = CreateObject ("WSCript.shell")
oShell.run "cmd /K cd/ & "& strJobDelete &"&"& strJob &"& exit"
Set oShell = Nothing

DOS -commands and it's help from command prompt

Above are the commands which are using from dos- prompt.
Below is the example for how to use and how to get help for those commands.
1. Help for Shut Down:
2. Help for Schedule task: