Answer the question
In order to leave comments, you need to log in
How to use variable in Powershell with text "_Classes"?
Hey!
I'm gaining experience with Powershell, but I can't find the answer to my question. The bottom line is this:
There is a script that gets the user's SID
$CurrentUser = Read-host "Name of current user"
$objUser = New-Object System.Security.Principal.NTAccount($CurrentUser)
$CurrentUserSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier])
Answer the question
In order to leave comments, you need to log in
"\Registry\USER\$CurrentUserSID\SOFTWARE\
\Registry\USER\$CurrentUserSID" + "_Classes\SOFTWARE\" > file.txt
just remove write-output and stick _Classes...
or like this:
Write-Output "\Registry \USER\$CurrentUserSID\SOFTWARE\
\Registry\USER\$($CurrentUserSID)_Classes\SOFTWARE\" > file.txt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question