Jump to content

how to copy certain 'files' to desktop?


Recommended Posts

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


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

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

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 :rolleyes: oh wellz.

Link to comment
Share on other sites

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:00000001

The 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...