'
I run this batch on two different pc's and get two different results
Code: Select all
@echo off
start "wmic.EXE" /i /wait /high /min "%comspec%" /c 1^> "workFile1.TMP" wmic.EXE path WIN32_USERACCOUNT get Name
> "workFile2.TMP" type "workFile1.TMP"
> "workFile1.TMP" type "workFile2.TMP"
for /f "usebackq delims=" %%? in ( "workFile1.TMP" ) do echo.?=%%?_
PC 1 = WinXPPro32x86 Service Pack 2
Code: Select all
?=Name _
...
?=HelpAssistant _
?=SUPPORT_388945a0 _
Druk op een toets om door te gaan. . .
PC 2 = WinXPPro32x86 Service Pack 1
Code: Select all
_=Name
...
_=HelpAssistant
_=SUPPORT_388945a0
Druk op een toets om door te gaan. . .
I then look whether the output files are somehow different and yes they are
Code: Select all
@echo off
for /f "usebackq delims=" %%? in ( "workFilePC1.TMP" ) do echo.?=%%?_
for /f "usebackq delims=" %%? in ( "workFilePC2.TMP" ) do echo.?=%%?_
pause
exit
Code: Select all
?=Name _
...
?=HelpAssistant _
?=SUPPORT_388945a0 _
_=Name
...
_=HelpAssistant
_=SUPPORT_388945a0
Druk op een toets om door te gaan. . .
workFilePC1.TMP
Code: Select all
// Generated by Hackman Hex Editor 8.0 pro
// workFilePC1.TMP - Starting offset: 0000:0000
0000:0000 4E 61 6D 65 20 20 20 20 20 20 20 20 20 20 20 20
0000:0010 20 20 0D 0A 48 65 6C 70 41 73 73 69 73 74 61 6E
0000:0020 74 20 20 20 20 20 0D 0A 53 55 50 50 4F 52 54 5F
0000:0030 33 38 38 39 34 35 61 30 20 20 0D 0A
workFilePC2.TMP
Code: Select all
// Generated by Hackman Hex Editor 8.0 pro
// workFilePC2.TMP - Starting offset: 0000:0000
0000:0000 4E 61 6D 65 20 20 20 20 20 20 20 20 20 20 20 20
0000:0010 20 20 0D 0D 0A 48 65 6C 70 41 73 73 69 73 74 61
0000:0020 6E 74 20 20 20 20 20 0D 0D 0A 53 55 50 50 4F 52
0000:0030 54 5F 33 38 38 39 34 35 61 30 20 20 0D 0D 0A 0D
0000:0040 0A 0D 0A
So the problem seems to be inside wmic's output
So the solution is to change every 0D 0D 0A into 0D 0A, translated
The solution is to change every <CR><CR><LF> to <CR><LF>
Thanks for the link, but I already figure that out, 0,-1
http://stackoverflow.com/questions/8099 ... ring-error