I have another question about using the Userprofile variable in a script. The script is to run a certain file on each users desktop. I have the following in my script:
However it doesn't appear to accept the code. If I substitute %userprofile% with the direct userprofile name, the script works great, however this will be for hundreds of users and not feasible to hardcode all those in. What do I need to do in order to be able to use the %userprofile% environment variable within the file path?
Enkrypted
A+
Code:
UserProfilePath = oshell.ExpandEnvironmentStrings("%UserProfile%")
Else Return = WshShell.Run("""C:\Documents and Settings\%UserProfile%\Desktop\file.exe""", 1)
However it doesn't appear to accept the code. If I substitute %userprofile% with the direct userprofile name, the script works great, however this will be for hundreds of users and not feasible to hardcode all those in. What do I need to do in order to be able to use the %userprofile% environment variable within the file path?
Enkrypted
A+