Ein ehemaliger Arbeitskollege hat das mal geschrieben.
Ich denke er hat nichts dagegen, wenn es mehr leuten zu nütze wird.
- #Create Shortcut PS V1.1
- #M. Kuschel 14.11.2012
-
- $wshell = New-Object -comObject WScript.Shell
- $AllUsersProgramsPath = $wshell.SpecialFolders.Item('AllUsersPrograms')
-
- #Set Shortcut Folder
- $spath = $AllUsersProgramsPath + "\OCP"
-
- if (!(Test-Path -path $spath))
- {
- New-Item $spath -type directory
- }
-
- $link = $wshell.CreateShortcut("$spath\OCP.lnk")
- $link.TargetPath = 'C:\Sisban\SisBan.exe'
- $link.Description = 'starts OCP'
- $link.WorkingDirectory = 'C:\Sisban'
- $link.IconLocation = 'C:\Sisban\SisBan.exe'
- $link.Save()