I would like to put together a script that will delete a folder located on a server, and then run a scheduled task on the server.
I'm unsure how to go about this. Any advise?

I would like to put together a script that will delete a folder located on a server, and then run a scheduled task on the server.
I'm unsure how to go about this. Any advise?

deltree [path of folder] /S /Q
Shove that in a file with the extension .bat and then add it to tasksheduler.

OK, I don't think I explained myself well enough.
What I want to do is run a script on my PC that will connect to a server I choose and delete a specific folder on the S drive.
I then want to run a scheduled task that is already in the servers task scheduler.
When using that can you use a UNC path or does the UNC path have to have a drive letter assigned ?
Also you may need to use WMI or WMIC ( depending on whether you are using command line ie a bat file or vbscript )
WMI for vbscript or WMIC for a bat script to do the remote stuff ( using the win32_process ) that should allow you to launch or execute remote processes to run the task scheduler on the server - not done this before so that would be a new one and with the WMI side you most likely will need to authenticate against the server using your login credentials
This is possible, have a look at psexec, you can create a batch file.
Try something like the following:
psexec \\computer -u localadmin -p password -i c:\program.exe
There are currently 1 users browsing this thread. (0 members and 1 guests)