+ Post New Thread
Results 1 to 5 of 5
Coding Thread, Is it possible... in Coding and Web Development; I would like to put together a script that will delete a folder located on a server, and then run ...
  1. #1
    Guest

    Join Date
    Jun 2009
    Posts
    3,754
    Thank Post
    1,458
    Thanked 490 Times in 375 Posts
    Rep Power
    0

    Is it possible...

    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?

  2. #2


    Join Date
    Jul 2007
    Location
    Rural heck
    Posts
    2,662
    Thank Post
    120
    Thanked 434 Times in 353 Posts
    Rep Power
    126
    deltree [path of folder] /S /Q

    Shove that in a file with the extension .bat and then add it to tasksheduler.

  3. #3
    Guest

    Join Date
    Jun 2009
    Posts
    3,754
    Thank Post
    1,458
    Thanked 490 Times in 375 Posts
    Rep Power
    0
    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.

  4. #4

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,766
    Thank Post
    3,274
    Thanked 1,053 Times in 974 Posts
    Rep Power
    365
    Quote Originally Posted by K.C.Leblanc View Post
    deltree [path of folder] /S /Q

    Shove that in a file with the extension .bat and then add it to tasksheduler.
    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

  5. #5

    Join Date
    May 2008
    Location
    Cheshire
    Posts
    292
    Thank Post
    48
    Thanked 27 Times in 24 Posts
    Rep Power
    18
    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

SHARE:
+ Post New Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •