I'm trying to write batch script to create a folder if it does not already exist. Following up the online examples, below is my script.
The problem is; first pause
works, then probably due to syntax error the window closes even before reaches to the second pause
, so I can't really tell which part of my script is wrong.
Could anyone show me how to prevent closing window so that I can see what's on the window?
@echo off :copy theme images over :designer echo copying theme images over... pause if not exist "%K2DIR%\K2 SmartForms Runtime\Styles\Themes\Sharepoint 2013\rich_text" ( md "%K2DIR%\K2 SmartForms Runtime\Styles\Themes\Sharepoint 2013\rich_text333" ) pause
You could put this line at the beginning of the batch file:
if not defined in_subprocess (cmd /k set in_subprocess=y ^& %0 %*) & exit )
What this line does is, the first time you run it, it re-launches itself in a subprocess that doesn't exit after it finishes running the batch file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With