Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Is this reg string unique to each install?

Featured Replies

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.


  • Author

No no it's cool :D 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=%%i

Do you know what the key S-1-5-21 is?

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 by evilvoice

  • Author

That clears it all up. Learning a new thing every day ;)

Thank's again for your efford!

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 by evilvoice

Thanks man. This helps alot! :D

One thing though, why do I need to make the temp.txt?

Also is not S-1-5-XX really unique?

@echo off
for /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 by Bilou_Gateux

ya know, where were you before I did all that work??? LOL...good job, so ^ is like an escape character.

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 Pages

Note the use of carets as escape characters for the pipe symbols within the brackets of the FOR loop!

Edited by Bilou_Gateux

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...

  • Author
Thanks man. This helps alot! :D

One thing though, why do I need to make the temp.txt?

Also is not S-1-5-XX really unique?

@echo off
for /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)?

Actually that did just output "your security ID is"

  • Author

I think you should not have included the ()

This seems to work

@echo off
for /f "delims=\ tokens=2" %%i in ('reg query HKU ^| findstr /V /E Classes ^| findstr "S-1-5-21"') do set SID=%%i

echo %SID%

exit

:thumbup

  • Author

Am I doing something wrong? This pasted into a .cmd outputs nothing and closes the window.

if you're not working in a cmd window when you run it, then change the last line to

  • pause&endlocal&goto :eof

<Edit>

If you're running as the Administrator, the SID key always ends in -500

</Edit>

Edited by Yzöwl

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.