Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Remote Commander (permanent)

sweenig Feb 27th, 2014 1,000 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. @echo off
  2. net use Y: \\sourceserver\d$
  3. for /F %%A in (%1) do (
  4.  echo %%A
  5. ::map a drive to the destination
  6.  net use z: \\%%A\d$
  7. ::copy the updated batch
  8.  copy /y Y:\updateproperties.bat Z:\updateproperties.bat
  9. ::create the scheduled task (the /st argument has to be a 4 digit, military time 8:00 is invalid, it should be 08:00)
  10.  schtasks /create /s %%A /tn "Update Properties" /tr D:\updateproperties.bat /sc daily /st 22:00 /ru System
  11. ::run the task
  12.  schtasks /run /s %%A /tn "Update Properties"
  13. ::disconnect the mapped drive
  14.  net use z: /delete
  15. )
  16. net use y: /delete
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top