ZTree.com  | ZEN  | About...  

 Index   Back

[Q] batch anomalies related with SID and >> operator   [Q]

By: Peter Shute       
Date: Sep 17,2017 at 20:57
In Response to: [Q] batch anomalies related with SID and >> operator (Ryan)

>
> anomaly 1
> AA=
> @ECHO OFF
> SET SID1=WMIC useraccount where name="%%USERNAME%%" get sid
> ECHO %SID1%
> FOR /F "DELIMS=" %%%V IN ('"%SID1%"') DO SET SID2=%%%V
> ECHO %SID2%
> PAUSE
>
> AA= works in XP, but it doesnt work in 8.1 and probably not in win10.
> so if your variable is the same as the SID (secret identifier), does
> these NEW OS's reject the variable?

SID stands for Security Identifier. I've never used the WMIC command before, it looks useful.

I can't imagine any of those other commands care if variables contain a SID or not. Have you compared the output of WMIC useraccount where name="%%USERNAME%%" get sid
from Win 10 and XP? Does each show the same thing for echo %sid1%?

314 views      
Thread locked
 

Messages in this Thread

 
94,723 Postings in 11,942 Threads, 348 registered users, 18 users online (1 registered, 17 guests)
Index | Admin contact |   Forum Time: Jan 25, 2020 - 12:21 pm EST  |  Hits:29,780,138  (5,063 Today )
RSS Feed