/build/static/layout/Breadcrumb_cap_w.png

enviro var for logged on user desktop

Guys, I need to script a path to the logged on user's desktop and to their start menu folder.
%USERPROFILE%\desktop\
does not work.. it tried to resolve it but it doesn't like the long-file-names in "documents and settings".

Easy one for you.

Thanks.

0 Comments   [ + ] Show comments

Answers (2)

Posted by: turbokitty 19 years ago
6th Degree Black Belt
0
I figured it out... you can't use the enviro variable itself in a string like this "%USERPROFILE\desktop".. you have to do this:

WSH1.ExpandEnvironmentStrings("%USERPROFILE%") & "\Start Menu\Programs\"
Posted by: turbokitty 19 years ago
6th Degree Black Belt
0
And here's a script snippet that goes through all the userprofiles..

' Get a list of all existing profiles
Set f = fso.GetFolder("C:\Documents and Settings")
Set sf = f.SubFolders

For Each f1 in sf
If (fso.FileExists("C:\Documents and Settings\" + f1.name + "\{some path}")) Then
fso.DeleteFile "C:\Documents and Settings\" + f1.name + "\{some path}", True
End If
Next
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ