larciel Posted March 25, 2004 Share Posted March 25, 2004 Hi, i'm trying to copy some 'shortcut files' into desktop when UnAttend install ends.i guess i need to use 'cmd' file to do that?i tried testing it out, but i couldn't get it to copy from $1\ to $1\documents and settings\administrator\ (or all users)\ desktop anyone knows how to do it, i'd really appreciate feedback.thank you Link to comment Share on other sites More sharing options...
Ausmith1 Posted March 25, 2004 Share Posted March 25, 2004 You could use the "Shortcut" utility from the resource kit to actually create shortcuts wherever you want them. Here is how I do it:shortcut.exe -f -t "%ProgramFiles%\SysInternals\autoruns.exe" -n "%ALLUSERSPROFILE%\Start Menu\Programs\AutoRuns.lnk" -i "%ProgramFiles%\SysInternals\autoruns.exe" Link to comment Share on other sites More sharing options...
gosh Posted March 26, 2004 Share Posted March 26, 2004 SP2 RC1 adds a shortcut to the desktop. It does this by a setting in it's inf. I highly doubt anyone would want to modify sp2's inf to simply add a shortcut to the desktop, but doesn't sp2 use the same update.exe that hotfixes use? Maybe you could modify a hotfix's inf to add a shortcut to the desktop. This is pure speculation, but an idea someone might want to try.-gosh Link to comment Share on other sites More sharing options...
Jono Posted March 26, 2004 Share Posted March 26, 2004 why not use the $docs folder which points direct to the documents and settings folder,i.e $docs\all users\desktop $docs\all users\start menu\programs Link to comment Share on other sites More sharing options...
Ausmith1 Posted March 26, 2004 Share Posted March 26, 2004 Because I'm running this code on Windows 2000 Advanced Server systems... Link to comment Share on other sites More sharing options...
Jono Posted March 26, 2004 Share Posted March 26, 2004 maybe if you had stated that in the 1st place, windows 2k supports the $docs as far as i am aware as well Link to comment Share on other sites More sharing options...
Alanoll Posted March 26, 2004 Share Posted March 26, 2004 as far as I am aware, 2k doesn't support the Oobe folders. i.e. $Docs and $AllUsers hmmm, the shortcut.exe program could come in handy, but it's not in the XP deploy kit, and I don't have the resource kit oh wellz. Link to comment Share on other sites More sharing options...
visaversa Posted March 26, 2004 Share Posted March 26, 2004 and XPLODE does the same trick copying shotrcuts...Look here Link to comment Share on other sites More sharing options...
RayOK Posted March 26, 2004 Share Posted March 26, 2004 Shortcut.exe? Where do I get the resource kit? (or wherever that nifty little program is?)Why doesn't this work?COPY "%SYSTEMDRIVE%\shortcut.lnk" "%ALLUSERSPROFILE%\Desktop" Link to comment Share on other sites More sharing options...
Ausmith1 Posted March 26, 2004 Share Posted March 26, 2004 Well, Windows shortcuts are not the same as UNIX symlinks and so the lnk file that works on one system will often not work on another system.This is because when a shortcut .LNK file is copied to another machine, then by default the shortcut's target will be automatically updated - e.g. create a shortcut on Machine1 to C:\AUTOEXEC.BAT when copied to Machine2 the shortcut will point back to \\Machine1\c$\AUTOEXEC.BAT To change this default - add this to the registry before creating the shortcut:HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"LinkResolveIgnoreLinkInfo"=dword:00000001The Shortcut utility can fix these problems with existing lnk files, but I have found it to be easier just to generate new shortcuts.Here is a link to another utility that will do the same thing for you.Another option is to use a wsh script: (optional args are commented out) Set oWS = WScript.CreateObject("WScript.Shell") sLinkFile = "C:\MyShortcut.LNK" Set oLink = oWS.CreateShortcut(sLinkFile) oLink.TargetPath = "C:\Program Files\MyApp\MyProgram.EXE" 'oLink.Arguments = "" 'oLink.Description = "MyProgram" 'oLink.HotKey = "ALT+CTRL+F" 'oLink.IconLocation = "C:\Program Files\MyApp\MyProgram.EXE, 2" 'oLink.WindowStyle = "1" 'oLink.WorkingDirectory = "C:\Program Files\MyApp" oLink.Save Link to comment Share on other sites More sharing options...
Sunil Posted March 26, 2004 Share Posted March 26, 2004 you can get the shortcut.exe tool from the site listed belowhttp://optimumx.com/download/#Shortcut 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