evilvoice Posted August 7, 2005 Share Posted August 7, 2005 no S-1-5-xx is not unique...just the characters after it...the reason for temp.txt is so you can set a variable...the for command wont work any other way...and i dont know of another method for setting a variable. Link to comment Share on other sites More sharing options...
BoardBabe Posted August 7, 2005 Author Share Posted August 7, 2005 No no it's cool I was just wondering since you did not use a .txt in the example:for /f "tokens=5 skip=2" %%i in ('reg query HKCU\Identities /v "Default User ID"') do set Identity=%%iDo you know what the key S-1-5-21 is? Link to comment Share on other sites More sharing options...
evilvoice Posted August 7, 2005 Share Posted August 7, 2005 (edited) as far as what it pertains to on the system, no...but i do know I have a S-1-5-21 key, so do you, from your quote in the first post, and so does every other pc ive ever been on...as I edited in my post before, I said what keys are under HKU, I have not seen more or less, just those...and the S-1-5-21 keys are the only ones different and thats only cuz of the characters after it...I could tell you what my key is, but its not gonna be the same as yours...Also, the reason a temp.txt was not needed for Identities was because we didnt need to use |...Also, another reason is because in the example I was able to use the full subkey...whereas, since we do not know what the FULL subkey will be from pc to pc, I have to pull all subkeys, find the one we want, and set it to a variable. Edited August 7, 2005 by evilvoice Link to comment Share on other sites More sharing options...
BoardBabe Posted August 7, 2005 Author Share Posted August 7, 2005 That clears it all up. Learning a new thing every day Thank's again for your efford! Link to comment Share on other sites More sharing options...
evilvoice Posted August 7, 2005 Share Posted August 7, 2005 (edited) now, your gonna have to figure out what the reg add command you need to add...cuz I cant really tell if Gestures is a keyname or subkey from your quote...but if you open regedit and a cmd window and do a reg add /? you should be able to come up with the right command. Edited August 7, 2005 by evilvoice Link to comment Share on other sites More sharing options...
Bilou_Gateux Posted August 7, 2005 Share Posted August 7, 2005 (edited) Thanks man. This helps alot! One thing though, why do I need to make the temp.txt?Also is not S-1-5-XX really unique?<{POST_SNAPBACK}>@echo offfor /f "delims=\ tokens=2" %%i in ('reg query HKU ^| findstr /V /E Classes ^| findstr "S-1-5-21"') do (set SID=%%i)&(echo. your Security ID is %SID%)What is a SID (Security ID)? Edited August 7, 2005 by Bilou_Gateux Link to comment Share on other sites More sharing options...
evilvoice Posted August 7, 2005 Share Posted August 7, 2005 ya know, where were you before I did all that work??? LOL...good job, so ^ is like an escape character. Link to comment Share on other sites More sharing options...
Bilou_Gateux Posted August 7, 2005 Share Posted August 7, 2005 (edited) I agree with you, you have done all the job.i must admit i'm very bad in batch scripting (noob?) but i use a very good reference:Rob van der Woude's Scripting PagesNote the use of carets as escape characters for the pipe symbols within the brackets of the FOR loop! Edited August 7, 2005 by Bilou_Gateux Link to comment Share on other sites More sharing options...
evilvoice Posted August 7, 2005 Share Posted August 7, 2005 LOL i did not mean it that way...just saying that it was nice to get a full method going...I really wasnt even going to work on it today, but I decided I had some time...I just assumed you already had the method...though there is always a chance to learn...I had no idea about the ^...hell that would save a lot of my temp.txt's running around... Link to comment Share on other sites More sharing options...
BoardBabe Posted August 7, 2005 Author Share Posted August 7, 2005 Thanks man. This helps alot! One thing though, why do I need to make the temp.txt?Also is not S-1-5-XX really unique?<{POST_SNAPBACK}>@echo offfor /f "delims=\ tokens=2" %%i in ('reg query HKU ^| findstr /V /E Classes ^| findstr "S-1-5-21"') do (set SID=%%i)&(echo. your Security ID is %SID%)What is a SID (Security ID)?<{POST_SNAPBACK}>Actually that did just output "your security ID is" Link to comment Share on other sites More sharing options...
BoardBabe Posted August 7, 2005 Author Share Posted August 7, 2005 I think you should not have included the ()This seems to work@echo offfor /f "delims=\ tokens=2" %%i in ('reg query HKU ^| findstr /V /E Classes ^| findstr "S-1-5-21"') do set SID=%%iecho %SID%exit Link to comment Share on other sites More sharing options...
Yzöwl Posted August 7, 2005 Share Posted August 7, 2005 (edited) Code deleted, please see the updated version. Edited August 9, 2005 by Yzöwl Link to comment Share on other sites More sharing options...
BoardBabe Posted August 7, 2005 Author Share Posted August 7, 2005 Am I doing something wrong? This pasted into a .cmd outputs nothing and closes the window. Link to comment Share on other sites More sharing options...
Yzöwl Posted August 7, 2005 Share Posted August 7, 2005 (edited) if you're not working in a cmd window when you run it, then change the last line topause&endlocal&goto :eof<Edit>If you're running as the Administrator, the SID key always ends in -500</Edit> Edited August 7, 2005 by Yzöwl Link to comment Share on other sites More sharing options...
BoardBabe Posted August 7, 2005 Author Share Posted August 7, 2005 (edited) Deleted Edited August 25, 2005 by BoardBabe Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now