Glad you got something to work. I just tried it again to be sure it works as
advertised and it does. In order to use;
%allusersprofile%
You would have to do something like;
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("Process")
WScript.Echo WshSysEnv("allusersprofile")
--
Regards,
Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
:
|I tried that code below on my own system and it didn't do anything at
first.
| I did change the path from S to F. After looking at that first link you
gave
| me (
http://optimumx.com/download/#Shortcut) and looking at their example,
I
| changed your code just a little bit:
|
| strDesktop = WshShell.SpecialFolders("AllUsersDesktop")
|
| changed to:
|
| strDesktop = WshShell.SpecialFolders("%allusersprofile%\desktop")
|
| That worked perfectly!
|
| Thanks A LOT for your help Dave.
|
| Jim
|
|
|
| | >A couple of ways to do this include using the CreateShortcut method of
| > VBScript. Or try Marty List's cool tool Shortcut v. 100
| >
http://optimumx.com/download/#Shortcut
| >
| >
| > This VBScript would create a shortcut to a mapped drive 'S:\'
| > --------------------------
| > set WshShell = WScript.CreateObject("WScript.Shell")
| > strDesktop = WshShell.SpecialFolders("AllUsersDesktop")
| > set oShellLink = WshShell.CreateShortcut(strDesktop & "\S Drive.lnk")
| > oShellLink.TargetPath = "S:\"
| > oShellLink.WindowStyle = 1
| > oShellLink.IconLocation = "explorer.exe, 1"
| > oShellLink.Description = "Network S Drive"
| > oShellLink.WorkingDirectory = "S:\"
| > oShellLink.Save
| > Set WshShell = Nothing
| > Set oShellLink = Nothing
| > --------------------------
| >
| > Also WSH 5.6 documentation download at
| >
http://www.microsoft.com/downloads/...48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en
| >
| >
| >
| > --
| > Regards,
| >
| > Dave Patrick ....Please no email replies - reply in newsgroup.
| > Microsoft Certified Professional
| > Microsoft MVP [Windows]
| >
http://www.microsoft.com/protect
| >
| > "Jim in Arizona" wrote:
| > |I want to make a logon script for domain users that do the following
when
| > | they log on:
| > |
| > | 1) make a directory on the c drive (i know I can do this using md
| > | c:\path)
| > | 2) copy a file from a network drive to the newly created local
folder
| > | (which I can do with xcopy "f:\network path\file.mdb"
| > "c:\path\file.mdb")
| > | 3) make a shortcut of c:\path\file.mdb to all users\desktop
| > |
| > | Number 3 is where that gets really confusing for me. I have no idea.
| > |
| > | Thanks for your help.
| > |
| > | Jim
| > |
| > |
| >
| >
|
|