SHARE
TWEET

Untitled

a guest Jun 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2.  
  3. C:UsersmeDocumentsPSToolsPsExec \10.45.12.12 -u "mydomainmyuser" -p "mypwd" %windir%system32inetsrvappcmd stop sites "test.mysite.com"
  4.  
  5. sleep 5
  6.  
  7. for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
  8. set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
  9. set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
  10. set "fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%"
  11.  
  12. NET USE \10.45.12.12 /u:mydomainmyuser "mypwd"
  13.  
  14. rem moves files and directories then del source
  15. robocopy /e /move \10.45.12.12C$inetpubwwwroottest.mysite.com \10.45.12.12C$UsersmeDesktopOLD_web_buildstest.mysite%fullstamp%
  16.  
  17. rem copy vs published files to remote server. exclude the UL_LK folder
  18. robocopy C:UsersmeDesktop_REPOSinvwebopsInvWebOpsbinReleasenetcoreapp2.2publish \10.45.12.12C$inetpubwwwroottest.mysite.com /e /XD "C:UsersmeDesktop_REPOSinvwebopsInvWebOpsbinReleasenetcoreapp2.2publishwwwrootUL_LK"
  19.  
  20. rem restart test.mysite
  21. C:UsersmeDocumentsPSToolsPsExec \10.45.12.12 -u "mydomainmyuser" -p "mypwd" %windir%system32inetsrvappcmd start sites "test.mysite.com"
  22.  
  23. set /p DUMMY=Hit ENTER to continue...
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