batch file - Cmd window unexpectedly closes -
i have windows bach program im writing log computer time , down time.
im kinda new coding, have found how math time, dates here , @ robvanderwoude.com.
there found batch file that, using command line:
datediff [date1] [date2]    to days past when run program shuts-down after information gathered.
how program continue working?
    @echo off     %%a in (%date%) set today=%%a     ::test information     set lastdayran= 03/25/2015     datediff %today% %lastdayran%     pause      
the script closing because aren't using call run datediff.bat. when run script without using call, flow transfers second script , stays there. if use call, script flow returns original script once second script completes.
@echo off %%a in (%date%) set today=%%a ::test information set lastdayran= 03/25/2015 call datediff %today% %lastdayran% pause      
Comments
Post a Comment