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%?

291 views      
Thread locked
 

Messages in this Thread

 
94,579 Postings in 11,930 Threads, 348 registered users, 7 users online (0 registered, 7 guests)
Index | Admin contact |   Forum Time: Nov 14, 2019 - 3:56 am EST  |  Hits:29,092,431  (2,347 Today )
RSS Feed