Search found 555 matches

by miskox
27 Jul 2023 04:07
Forum: DOS Batch Forum
Topic: How to detect in 7-Zip fatal error #2 "Wrong password" in windows batch?
Replies: 2
Views: 1683

Re: How to detect in 7-Zip fatal error #2 "Wrong password" in windows batch?

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.

Code: Select all

7za.exe t -pWRONGPASS test.7z >nul 2>nul
echo %errorlevel%
Saso
by miskox
09 Jul 2023 22:56
Forum: DOS Batch Forum
Topic: Inserting comment within a broken line - is it possible? [WORKAROUND]
Replies: 8
Views: 2509

Re: Inserting comment within a broken line - is it possible?

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....
by miskox
04 Jul 2023 04:19
Forum: DOS Batch Forum
Topic: Inserting comment within a broken line - is it possible? [WORKAROUND]
Replies: 8
Views: 2509

Re: Inserting comment within a broken line - is it possible?

DOSadnie wrote:
04 Jul 2023 03:42
...but also time consuming...
I guess not because you usually do it only once.

Saso
by miskox
04 Jul 2023 04:18
Forum: DOS Batch Forum
Topic: Inserting comment within a broken line - is it possible? [WORKAROUND]
Replies: 8
Views: 2509

Re: Inserting comment within a broken line - is it possible?

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...
by miskox
03 Jul 2023 10:47
Forum: DOS Batch Forum
Topic: Inserting comment within a broken line - is it possible? [WORKAROUND]
Replies: 8
Views: 2509

Re: Inserting comment within a broken line - is it possible?

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...
by miskox
30 Jun 2023 05:55
Forum: DOS Batch Forum
Topic: NetBazmek - Windows networking subsytem helper
Replies: 3
Views: 2198

Re: NetBazmek - Windows networking subsytem helper

Nice work. I get some errors but this script is very useful.

(will check again and write down errors)

Saso
by miskox
27 Jun 2023 10:11
Forum: DOS Batch Forum
Topic: How to escape comma in wmic?
Replies: 10
Views: 4741

Re: How to escape comma in wmic?

Very good idea! Congratulations!

Saso
by miskox
27 Jun 2023 10:09
Forum: DOS Batch Forum
Topic: Is there a script to safely delete a file?
Replies: 3
Views: 1497

Re: Is there a script to safely delete a file?

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...
by miskox
25 Jun 2023 09:03
Forum: DOS Batch Forum
Topic: BAT does no start AHK when put in Startup folder of Windows 10 [SOLVED]
Replies: 4
Views: 2001

Re: BAT does no start AHK when put in Startup folder of Windows 10

Why don't you just execute:

Code: Select all

"C:\Program Files\AutoHotkey\AutoHotkey.exe" "C:\SCRIPTStest.ahk"
Saso
by miskox
21 Jun 2023 13:43
Forum: DOS Batch Forum
Topic: User defined prompt with dynamic data
Replies: 8
Views: 3627

Re: User defined prompt with dynamic data

Maybe you could find more info in VT 420 and VT 520 programmer reference manuals.

Saso
by miskox
21 Jun 2023 11:24
Forum: DOS Batch Forum
Topic: User defined prompt with dynamic data
Replies: 8
Views: 3627

Re: User defined prompt with dynamic data

Oh, yes! Now I see. I was completely wrong. Prompt. Prompt. And not 'set /p'. Looks like it was a hard day.

Saso
by miskox
21 Jun 2023 06:36
Forum: DOS Batch Forum
Topic: User defined prompt with dynamic data
Replies: 8
Views: 3627

Re: User defined prompt with dynamic data

@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...