Category : batch-file

I cannot figure out how to echo the date and time, with a zero padded hour, to insert a timestamp in my batch files. The following is the set command that I use to echo the date and time: set _DateTime=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%_%time:~0,2%-%time:~3,2% echo _DateTime=%_DateTime% The following is what the code above generated in the console window ..

Read more

Inside the %list% txt file there are multiple paths and inside %List2Backup% there are multiple files list only, I need to copy each file to each server name location based on first server name only example of location from %list% TestServer1D$Location1DraftsTestings TestServer2C$Location1DraftsTestings I want files to be copied to "%~dp0BackupDlls_%Environment%_%format:~-0,30%TestServer1filename.dll This is the current code ..

Read more

The main.bat file is in the autostart directory, it launches debug.exe, then it reads integer variable (i) from iteration.txt and creates another (i).bat in autostart, then increments i+1 and re-writes it’s value into iteration.txt. The script works properly as long as being executed by cmd or doubleclick, but when it is executed after system restart, ..

Read more