I am wondering if someone can clarify the proper use of the oShell.run
command at the bottom of the sample script below. I am importing a registry
file via WSH. The name of the file is in long format as indicated by the
stmpFile variable. Since the file name will be different for every user, I
want to pass the variable name instead of the file name. However the long
format is not allowing the import. I know I have to pass the quotes along
with the variable. I have tried several syntax however, none of which have
worked. Can anyone assist?
sTmpFile = "c:\Some long Name.reg"
' Write to the temporary registry file
fFile.WriteLine "Windows Registry Editor Version 5.00"
fFile.WriteLine
fFile.WriteLine
"[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\UserInfo]"
fFile.WriteLine """UserName""=hex:" & strUsernameHex
fFile.WriteLine """UserInitials""=hex:" & strInitialsHex
fFile.Close
oShell.Run "regedit /s " & sTmpFile, 0, True