I tested it with 7za.exe (console version on 7zip website). If there is an error (maybe just wrong password or any other - can't tell - didn't check that) ERRORLEVEL was set to 2. If OK ERRORLEVEL was 0.
Here is a test: @echo off echo ---------- sort by extension dir /b /oe echo ---------- sort by extension does not work dir /b REM comment /oe echo ----------end c:\temp>test.cmd ---------- sort by extension test.cmd 3.pdf 2.pdf 1.pdf ---------- sort by extension does not work 1.pdf 2.pdf 3.pdf test....
renders my script half-workihg, because it only creates a backup of the folder structure omitting all of the files I think the reason why it will not work is this: some_command /a /b /c /d will work. But if I add a comment: some_command /a /b^ REM some comment /c /d equals to: some_command /a /b RE...
Maybe you could write comments like this: robocopy "%sd%" "%dd%\%folder_name%" /E /XF "%sd%\desktop.ini" REM | | | | | REM | | | | \- comment 1 REM | | | \----------- comment 2 REM | | \-------------- comment 3 REM | \-- comment 4 (not right justifed) REM \-- comment 5 (not right justifed for exampl...
You have to open the existing file for read/write and set a filepointer to the beginning of it. So you need filepointer (see https://www.dostips.com/forum/viewtopic.php?f=3&t=5552&p=34051#p34051). So this means 3rd party program. In this case sdelete is your best option. Maybe someone has a better i...
@echo off set curr_time=%time% set /p "time_var=Time is %time%. Enter something:" echo time_var=%time_Var%_ set curr_time=%time% set /p "time_var=Time is %time%. Enter something:" echo time_var=%time_Var%_ echo. echo LOOP 1-10 for /L %%f in (1,1,10) do set/p variable_name=Counter %%f c:\>some_bat.c...