beabaul Posted September 8, 2009 Share Posted September 8, 2009 I have been racking my head all day trying to get a routine i've written to place an icon on the all users profile desktop. Sounds easy right?... thats what I thought..... or maybe it really is as i'm pretty new to this and not in anyway shape or form a coder by trade. This is the part of my code i'm having a problem with and the only thing I could come up with to do it. When It runs the "FileeMove" line it does work but for whatever reason loses the icon and description set with it. I have to believe there is a much more elegant way of doing this but there dosent seem to be any sort of %allusersprofile% type variables that can be used that I can find. Any help would be much appreciated. $FileName = "C:\millennium\iiirunner.exe" $LinkFileName = @DesktopDir & "\Millennium.lnk" $WorkingDirectory = @DesktopDir $Icon = "C:\millennium\iiirunner.ico" $IconNumber = 0 $Description = "Innovative Interfaces Millennium" $State = @SW_SHOWMAXIMIZED FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description,$Icon,"",$IconNumber,$State) FileMove (@DesktopDir & "\millennium.lnk", "c:\documents and settings\all users\desktop") Link to comment Share on other sites More sharing options...
Yashied Posted September 8, 2009 Share Posted September 8, 2009 Try replace @DesktopDir to @TempDir. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
MARAN Posted September 8, 2009 Share Posted September 8, 2009 (edited) FileCreateShortcut(@WindowsDir & "\notepad.exe", @DesktopCommonDir & "\Shortcut to Notepad.lnk", @WindowsDir) Edited September 8, 2009 by MARAN behdadsoft 1 [center][size="4"]MARAN came from a place many miles away from yours...[/size][/center] Link to comment Share on other sites More sharing options...
5t0n3r Posted September 14, 2009 Share Posted September 14, 2009 (edited) FileCreateShortcut("Path to EXE or Website address", @DesktopCommonDir & "\Name of Shortcut.lnk", "", "", "Hover over Text", "Path to icon file", "", "", "") Edited September 14, 2009 by 5t0n3r Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now