Search found 470 matches

by Liviu
15 Feb 2012 16:05
Forum: DOS Batch Forum
Topic: for in DOS batch - MSFN Forum
Replies: 10
Views: 2645

Re: for in DOS batch - MSFN Forum

for /r %%x in (.\www.slv.dk\Dokumenter\dsweb\Get) do echo "%%x\" This should list the directories in Get folder. No, that will actually run the 'for' loop without '/r' in the current directory and each of its subdirectories. You probably want this, instead. for /r ".\www.slv.dk\Dokum...
by Liviu
15 Feb 2012 15:53
Forum: DOS Batch Forum
Topic: MASSIVE XP_SP1 BUG [corrupted stdout affects all *.EXE] !
Replies: 23
Views: 5842

Re: [BUGFIX XP SP1] wmic corrupted stdout

I make another shocking discovery that may explain the weird behavior. On my XP service pack 1 wmic produces output in ANSI On my XP service pack 2 wmic produces output in unicode Well... Sp1 is about 10 years old. XP has had two massive service packs since, plus countless updates. I am shocked tha...
by Liviu
15 Feb 2012 00:39
Forum: DOS Batch Forum
Topic: foolproof counting of arguments
Replies: 56
Views: 43239

Re: foolproof counting of arguments

But piping do the same as the exit, as the pipe itself creates two seperate sub-tasks for each side. The prompt disappears in the child task which is never visible. Haven't followed this in any depth, but it doesn't look quite the same. The pipe closes both ends without any obvious 'exit' being typ...
by Liviu
14 Feb 2012 20:23
Forum: DOS Batch Forum
Topic: Batch file formatting, Diskpart formatting
Replies: 19
Views: 7785

Re: Batch file formatting, Diskpart formatting

Only i know what it does so if someone gets ahold of my drive they will accidentally activate it. ... but i need a batch to find what the drive letter is and to format all the contents with out requesting permission. Just curious, how is the drive supposed to know that it's "you" using it...
by Liviu
14 Feb 2012 18:22
Forum: DOS Batch Forum
Topic: MASSIVE XP_SP1 BUG [corrupted stdout affects all *.EXE] !
Replies: 23
Views: 5842

Re: wmic write/read weirdness ?!

Exactly what I tried to explain Indeed. I am still curious about Ed's: - implied cmd switches (guess there must be a /v:on, maybe others); - external definitions (though I assume !cr!, !lf! are the expected controls); - output of the code if '$name' is cleared before each 'for'. FWIW what I am gett...
by Liviu
14 Feb 2012 17:45
Forum: DOS Batch Forum
Topic: MASSIVE XP_SP1 BUG [corrupted stdout affects all *.EXE] !
Replies: 23
Views: 5842

Re: wmic write/read weirdness ?!

Can't really help here since it works as expected under my xp.sp3 (after converting the UTF-16LE file to plain text, that is). But, just curious, what's your Windows version and 32/64 bitness? for /f "usebackq skip=1 delims=" %%? in ( "workFile1.TMP" ) do set "$name=%%?"...
by Liviu
14 Feb 2012 12:41
Forum: DOS Batch Forum
Topic: foolproof counting of arguments
Replies: 56
Views: 43239

Re: foolproof counting of arguments

What is the exact syntax in context? Save Jeb's snippet as, say, stream3.cmd. Running it as such results in... C:\>stream3 C:\>rem # # cls exit ...where the prompt remains in an odd input state. The last two lines were typed in, 'cls' did nothing, and 'exit' does in fact close the console window on...
by Liviu
14 Feb 2012 11:26
Forum: DOS Batch Forum
Topic: foolproof counting of arguments
Replies: 56
Views: 43239

Re: foolproof counting of arguments

In my opinion there are only two problems left. We need a temporary file, it would be nicer if we could avoid this. Right. The other unfortunate side effect of using a temp file is that characters outside the current code page cannot be handled (while a straightforward "set arg1=%1" works...
by Liviu
13 Feb 2012 19:33
Forum: DOS Batch Forum
Topic: Minecraft World Extractor
Replies: 6
Views: 1717

Re: Minecraft World Extractor

i always get asked if it's a directory or file, then an incorrect path but im pretty sure it's correct That's easy to doublecheck, just try dir J:\30975\Stuff\Apps\Minecraft\Worlldextractorinstaller\worlds\saves dir C:\Users\%userprofile%\AppData\Roaming\.minecraft at the cmd prompt, and if those (...
by Liviu
13 Feb 2012 19:26
Forum: DOS Batch Forum
Topic: foolproof counting of arguments
Replies: 56
Views: 43239

Re: foolproof counting of arguments

EDIT: Reading is helpful I didn't realize that you used the word "EXTENSION" not "EXPANSION" You would never catch me failing to read properly ... noooooo, Not me In fact, I am pretty sure I've noticed that during an unrelated search, and it must have somehow stuck "disable...
by Liviu
11 Feb 2012 15:29
Forum: DOS Batch Forum
Topic: foolproof counting of arguments
Replies: 56
Views: 43239

Re: foolproof counting of arguments

Now I understand why jeb had that # in his REM statement, to protect against /? And only now do I understand why he had the space after # as well... REM appears to look for a '/?' all across the first argument (unless quoted) i.e. 'REM */?*' and 'REM a^&b%%c^(^!^<^|^>/^?...' both work just as '...
by Liviu
10 Feb 2012 11:35
Forum: DOS Batch Forum
Topic: Checking if 3 random numbers are same
Replies: 9
Views: 2582

Re: Checking if 3 random numbers are same

jeb wrote:

Code: Select all

if "%r1%,%r2%,%r3%"=="%r2%,%r3%,%r1%" echo All same

Nice! In the name of readability^H^H terseness I submit this works as well ;-)

Code: Select all

if "%r1%,%r2%"=="%r2%,%r3%" echo All same

Liviu
by Liviu
09 Feb 2012 21:35
Forum: DOS Batch Forum
Topic: Checking if 3 random numbers are same
Replies: 9
Views: 2582

Re: Checking if 3 random numbers are same

I suggest you to made this point clear by creating an auxiliary variable called AND this way: SET AND=IF IF %R1% == %R2% %AND% %R1% == %R3% ECHO YOU WIN I wouldn't find that too clear in general. It could easily mislead one to write... IF %R1% == %R2% %AND% %R1% == %R3% (ECHO YOU WIN) ELSE (ECHO YO...
by Liviu
09 Feb 2012 21:25
Forum: DOS Batch Forum
Topic: Previous boot time
Replies: 1
Views: 947

Re: Previous boot time

It's not clear what you mean by "previous". If it's the most recent reboot you can still use systeminfo even before the first login (lookup the /U /P switches). If it's about some prior reboot, then you could probably use WMI to scan the event log. In either case, a batch file may not be t...
by Liviu
09 Feb 2012 00:46
Forum: DOS Batch Forum
Topic: How Set/p works
Replies: 11
Views: 12032

Re: How Set/p works

I have done many test to better understand the way set/p operates especially when used with input-redirection. Neat! And confirmed under xp.sp3 (with dbenham's correction of 1,023 vs. 1,024). The longest line that can be processed reliably is 1021 (not including the terminating CRLF or LFCR). For a...