Options
Command line trigger to pause an execution
Matt27[lt]
Member Posts: 74 ■■□□□□□□□□
in Off-Topic
Situation. Occasionally I have to do an upgrade - run some *.bat files through the command line on the server.
Problem. It is a second time I failed and executed previous *.bat file instead of the newer version (file names are almost identiccally apart few numbers). Also it did not helped, that upgrades were done at night (and after overtime). So my concentration was low.
Possible solutions? At the begining of the *.bat file there is a line ("md Logs") which creates a folder "Logs" where upgrade's logs are placed. If I run an older version of upgrade, command line informs me that folder "Logs" exist and continues with upgrade. Is it possible to make a trigger or something right here? If the folder "Logs" exist make a pause and give me a solution "continue with an upgrade Y/N"?
Problem. It is a second time I failed and executed previous *.bat file instead of the newer version (file names are almost identiccally apart few numbers). Also it did not helped, that upgrades were done at night (and after overtime). So my concentration was low.
Possible solutions? At the begining of the *.bat file there is a line ("md Logs") which creates a folder "Logs" where upgrade's logs are placed. If I run an older version of upgrade, command line informs me that folder "Logs" exist and continues with upgrade. Is it possible to make a trigger or something right here? If the folder "Logs" exist make a pause and give me a solution "continue with an upgrade Y/N"?
Comments
-
OptionsPovilas Member Posts: 77 ■■■□□□□□□□Simplest way to use something like:
IF EXIST kazkas.log GOTO End
:End2013 to do list:
[70-413] [70-414] -
OptionsMatt27[lt] Member Posts: 74 ■■□□□□□□□□"kazkas" - it immediatly told me where you are from. Solution is welcomed, but log file (*.txt) name everytime is different. The constant thing is folder "Logs". How to write an IF command with a folder criteria? Thanks.
-
OptionsPovilas Member Posts: 77 ■■■□□□□□□□It doesn't matter if its file or folder. Just replace "kazkas.log" with "C:\logs" or something what you want to check.2013 to do list:
[70-413] [70-414]