takeFirstStringContaining
Verfasst: 05 Nov 2014, 13:19
Hi
I am trying to make a package, which deletes Windows 7 temporary profiles in the registry.
I use this command to get the the users SID:
This returns something like this:
Afterwards I want to delete this string in the registry:
The problem is that there is two white-spaces appended to the SID, like this:
Is there some way to get the string without the white spaces?
Regards
I am trying to make a package, which deletes Windows 7 temporary profiles in the registry.
I use this command to get the the users SID:
Code: Alles auswählen
Set $SIDcmd$ = getOutStreamFromSection ('DosInAnIcon_getuser')
Set $SID$ = takeFirstStringContaining($SIDcmd$,"S-")
[DosInAnIcon_getuser]
wmic useraccount where name='$UserProfileName$' get sid
Code: Alles auswählen
S-1-5-21-299502267-1647877149-1417001333-39507
Code: Alles auswählen
[Registry_install]
[HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$SID$.bak]
Code: Alles auswählen
S-1-5-21-299502267-1647877149-1417001333-39507 .bak
Regards