Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

All users desktop shortcut Win 7

Status
Not open for further replies.

Briandr

MIS
Jul 11, 2003
177
US
Hi,

Can someone show me how to create a all users desktop shortcut for Windows 7? Thank you.
 
the path is C:\ProgramData. There are shortcuts in Windows 7 to provide compatibility with XP (ie c:\Documents and Setting\All Users will point to c:\ProgramData).

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
Are there any sample VBScripts that can be used to accomplish this?
 
Code:
set objFSO = CreateObject("Scripting.FileSystemObject")

strAllUsers = "c:\Documents and Settings\All Users"
msgbox objFSO.GetFolder(strAllUsers).SubFiles.count

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
This line returns an error when run on a Windows 7 computer. I actually have a VBScript for creating a desktop shortcut for all users on XP. In this case I want to create a shortcut to a file on all users desktops for Windows 7. I'll paste what I have and any help tweaking this would be appreciated.
 
This code looks alot like the code I have used before.


option explicit
on error resume next
dim shell, desktopPath, link, sys32Path
Set shell = WScript.CreateObject("WScript.shell")
desktopPath = shell.SpecialFolders("Desktop")
sys32Path = "%SystemRoot%\system32"
Set link = shell.CreateShortcut(desktopPath & "\Defrag.lnk")
link.Description = "Defrag"
link.TargetPath = "c:\windows\system32\dfrgui.exe"
link.WindowStyle = 3
link.WorkingDirectory = desktopPath
link.Save
set shell = nothing
if err.number <> 0 then
msgbox "There was an error creating your shortcut." & vbCrLf & err.description & vbCrLf & err.source, vbOKOnly-vbExclamation, "Shortcut Builder"
else
msgBox "Your new shortcut has been created!" & vbCrLf & "Please check your Windows Desktop.", vbOKOnly-vbInformation, "Shortcut Builder"
end if


The only question I have is will this shortcut be on the desktop for each user that logs onto this computer?

I thought SpecialFolders("Desktop") would be SpecialFolders("AllUsersDesktop")

This is where I am getting confused.
 
oops, I changed the command when I posted (didn't test)

Code:
set objFSO = CreateObject("Scripting.FileSystemObject")strAllUsers = "c:\Documents and Settings\All Users"
msgbox objFSO.GetFolder(strAllUsers).Sub[red]Folders[/red].count

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top