![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Creating shortcuts with PowerShell Hi, is it possible to use Powershell to create a desktop shortcut icon to one of my company's programs. right now, i'm using a VB script to do it,but it would be better if i could get Powershell to do it. |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Creating shortcuts with PowerShell Yes. Take a look at a previous post if this helps. http://www.leedesmond.com/weblog/?p=60 Thanks. -- http://www.leedesmond.com/weblog/ "greatbarrier86" wrote: > Hi, > > is it possible to use Powershell to create a desktop shortcut icon to one of > my company's programs. right now, i'm using a VB script to do it,but it would > be better if i could get Powershell to do it. |
My System Specs![]() |
| | #3 (permalink) |
| | RE: Creating shortcuts with PowerShell Desmond Thanks...but it still is slightly confusing to me. I think i can get it Thanks!! "Desmond Lee" wrote: > Yes. Take a look at a previous post if this helps. > > http://www.leedesmond.com/weblog/?p=60 > > Thanks. > -- > http://www.leedesmond.com/weblog/ > > > > "greatbarrier86" wrote: > > > Hi, > > > > is it possible to use Powershell to create a desktop shortcut icon to one of > > my company's programs. right now, i'm using a VB script to do it,but it would > > be better if i could get Powershell to do it. |
My System Specs![]() |
| | #4 (permalink) |
| | RE: Creating shortcuts with PowerShell Give it a go and let us know if we could be of further help. Thanks greatbarrier86. -- http://www.leedesmond.com/weblog/ "greatbarrier86" wrote: > Desmond > > Thanks...but it still is slightly confusing to me. I think i can get it > > Thanks!! > > "Desmond Lee" wrote: > > > Yes. Take a look at a previous post if this helps. > > > > http://www.leedesmond.com/weblog/?p=60 > > > > Thanks. > > -- > > http://www.leedesmond.com/weblog/ > > > > > > > > "greatbarrier86" wrote: > > > > > Hi, > > > > > > is it possible to use Powershell to create a desktop shortcut icon to one of > > > my company's programs. right now, i'm using a VB script to do it,but it would > > > be better if i could get Powershell to do it. |
My System Specs![]() |
| | #5 (permalink) |
| | RE: Creating shortcuts with PowerShell Desmond, I'm lost...i apologize. Perhaps you could give me some help I'd like to put a shortcut on the C:\Users\Public\Desktop location pointing to C:\CPS\CPSAPP.exe Could you perhaps write that for me? At least then, i would understand it for future scripts. "Desmond Lee" wrote: > Give it a go and let us know if we could be of further help. > > > Thanks greatbarrier86. > > -- > http://www.leedesmond.com/weblog/ > > > > "greatbarrier86" wrote: > > > Desmond > > > > Thanks...but it still is slightly confusing to me. I think i can get it > > > > Thanks!! > > > > "Desmond Lee" wrote: > > > > > Yes. Take a look at a previous post if this helps. > > > > > > http://www.leedesmond.com/weblog/?p=60 > > > > > > Thanks. > > > -- > > > http://www.leedesmond.com/weblog/ > > > > > > > > > > > > "greatbarrier86" wrote: > > > > > > > Hi, > > > > > > > > is it possible to use Powershell to create a desktop shortcut icon to one of > > > > my company's programs. right now, i'm using a VB script to do it,but it would > > > > be better if i could get Powershell to do it. |
My System Specs![]() |
| | #6 (permalink) |
| | RE: Creating shortcuts with PowerShell $wshshell = New-Object -ComObject WScript.Shell $lnk = $wshshell.CreateShortcut("$home\Desktop\nameOfMyShortcut.lnk") $lnk.TargetPath = "C:\CPS\CPSAPP.exe" $lnk.Save() I reckon you are using Vista? In any case, the $home variable will send it to the correct folder. Let us know if this helps. Good night! -- http://www.leedesmond.com/weblog/ "greatbarrier86" wrote: > Desmond, > > I'm lost...i apologize. > > Perhaps you could give me some help > > I'd like to put a shortcut on the C:\Users\Public\Desktop location pointing > to C:\CPS\CPSAPP.exe > > Could you perhaps write that for me? At least then, i would understand it > for future scripts. > > "Desmond Lee" wrote: > > > Give it a go and let us know if we could be of further help. > > > > > > Thanks greatbarrier86. > > > > -- > > http://www.leedesmond.com/weblog/ > > > > > > > > "greatbarrier86" wrote: > > > > > Desmond > > > > > > Thanks...but it still is slightly confusing to me. I think i can get it > > > > > > Thanks!! > > > > > > "Desmond Lee" wrote: > > > > > > > Yes. Take a look at a previous post if this helps. > > > > > > > > http://www.leedesmond.com/weblog/?p=60 > > > > > > > > Thanks. > > > > -- > > > > http://www.leedesmond.com/weblog/ > > > > > > > > > > > > > > > > "greatbarrier86" wrote: > > > > > > > > > Hi, > > > > > > > > > > is it possible to use Powershell to create a desktop shortcut icon to one of > > > > > my company's programs. right now, i'm using a VB script to do it,but it would > > > > > be better if i could get Powershell to do it. |
My System Specs![]() |
| | #7 (permalink) |
| | RE: Creating shortcuts with PowerShell Wow...thank you. $home equals the Public Desktop folder? "Desmond Lee" wrote: > $wshshell = New-Object -ComObject WScript.Shell > $lnk = $wshshell.CreateShortcut("$home\Desktop\nameOfMyShortcut.lnk") > $lnk.TargetPath = "C:\CPS\CPSAPP.exe" > $lnk.Save() > > > I reckon you are using Vista? In any case, the $home variable will send it > to the correct folder. > > Let us know if this helps. Good night! > > -- > http://www.leedesmond.com/weblog/ > > > > "greatbarrier86" wrote: > > > Desmond, > > > > I'm lost...i apologize. > > > > Perhaps you could give me some help > > > > I'd like to put a shortcut on the C:\Users\Public\Desktop location pointing > > to C:\CPS\CPSAPP.exe > > > > Could you perhaps write that for me? At least then, i would understand it > > for future scripts. > > > > "Desmond Lee" wrote: > > > > > Give it a go and let us know if we could be of further help. > > > > > > > > > Thanks greatbarrier86. > > > > > > -- > > > http://www.leedesmond.com/weblog/ > > > > > > > > > > > > "greatbarrier86" wrote: > > > > > > > Desmond > > > > > > > > Thanks...but it still is slightly confusing to me. I think i can get it > > > > > > > > Thanks!! > > > > > > > > "Desmond Lee" wrote: > > > > > > > > > Yes. Take a look at a previous post if this helps. > > > > > > > > > > http://www.leedesmond.com/weblog/?p=60 > > > > > > > > > > Thanks. > > > > > -- > > > > > http://www.leedesmond.com/weblog/ > > > > > > > > > > > > > > > > > > > > "greatbarrier86" wrote: > > > > > > > > > > > Hi, > > > > > > > > > > > > is it possible to use Powershell to create a desktop shortcut icon to one of > > > > > > my company's programs. right now, i'm using a VB script to do it,but it would > > > > > > be better if i could get Powershell to do it. |
My System Specs![]() |
| | #8 (permalink) |
| | Re: Creating shortcuts with PowerShell Usually the Desktop folder is a subfolder of the user's profile, but not always. It might be safer to ask the Shell (Explorer) for the current user's Desktop path: $ShellApplication = New-Object –com Shell.Application $DesktopFolderID = 0x10 $DesktopFolderPath = ($ShellApplication.namespace($DesktopFolderID)).Self.Path "greatbarrier86" <greatbarrier86@discussions.microsoft.com> wrote in message news:4F99C25F-0F7E-411B-8F2F-957E855E5610@microsoft.com... > Wow...thank you. > $home equals the Public Desktop folder? > > "Desmond Lee" wrote: > >> $wshshell = New-Object -ComObject WScript.Shell >> $lnk = $wshshell.CreateShortcut("$home\Desktop\nameOfMyShortcut.lnk") >> $lnk.TargetPath = "C:\CPS\CPSAPP.exe" >> $lnk.Save() >> >> >> I reckon you are using Vista? In any case, the $home variable will send >> it >> to the correct folder. >> >> Let us know if this helps. Good night! >> >> -- >> http://www.leedesmond.com/weblog/ >> >> >> >> "greatbarrier86" wrote: >> >> > Desmond, >> > >> > I'm lost...i apologize. >> > >> > Perhaps you could give me some help >> > >> > I'd like to put a shortcut on the C:\Users\Public\Desktop location >> > pointing >> > to C:\CPS\CPSAPP.exe >> > >> > Could you perhaps write that for me? At least then, i would understand >> > it >> > for future scripts. >> > >> > "Desmond Lee" wrote: >> > >> > > Give it a go and let us know if we could be of further help. >> > > >> > > >> > > Thanks greatbarrier86. >> > > >> > > -- >> > > http://www.leedesmond.com/weblog/ >> > > >> > > >> > > >> > > "greatbarrier86" wrote: >> > > >> > > > Desmond >> > > > >> > > > Thanks...but it still is slightly confusing to me. I think i can >> > > > get it >> > > > >> > > > Thanks!! >> > > > >> > > > "Desmond Lee" wrote: >> > > > >> > > > > Yes. Take a look at a previous post if this helps. >> > > > > >> > > > > http://www.leedesmond.com/weblog/?p=60 >> > > > > >> > > > > Thanks. >> > > > > -- >> > > > > http://www.leedesmond.com/weblog/ >> > > > > >> > > > > >> > > > > >> > > > > "greatbarrier86" wrote: >> > > > > >> > > > > > Hi, >> > > > > > >> > > > > > is it possible to use Powershell to create a desktop shortcut >> > > > > > icon to one of >> > > > > > my company's programs. right now, i'm using a VB script to do >> > > > > > it,but it would >> > > > > > be better if i could get Powershell to do it. |
My System Specs![]() |
| | #9 (permalink) |
| | Re: Creating shortcuts with PowerShell Marty I dont want the current user. I would actually like the shortcut to apply to all users. Could i just do $lnk = $wshshell.CreateShortcut("C:\Users\Public\Desktop\nameOfMyShortcut.lnk") "Marty List" wrote: > > Usually the Desktop folder is a subfolder of the user's profile, but not > always. It might be safer to ask the Shell (Explorer) for the current > user's Desktop path: > > $ShellApplication = New-Object –com Shell.Application > $DesktopFolderID = 0x10 > $DesktopFolderPath = > ($ShellApplication.namespace($DesktopFolderID)).Self.Path > > > "greatbarrier86" <greatbarrier86@discussions.microsoft.com> wrote in message > news:4F99C25F-0F7E-411B-8F2F-957E855E5610@microsoft.com... > > Wow...thank you. > > $home equals the Public Desktop folder? > > > > "Desmond Lee" wrote: > > > >> $wshshell = New-Object -ComObject WScript.Shell > >> $lnk = $wshshell.CreateShortcut("$home\Desktop\nameOfMyShortcut.lnk") > >> $lnk.TargetPath = "C:\CPS\CPSAPP.exe" > >> $lnk.Save() > >> > >> > >> I reckon you are using Vista? In any case, the $home variable will send > >> it > >> to the correct folder. > >> > >> Let us know if this helps. Good night! > >> > >> -- > >> http://www.leedesmond.com/weblog/ > >> > >> > >> > >> "greatbarrier86" wrote: > >> > >> > Desmond, > >> > > >> > I'm lost...i apologize. > >> > > >> > Perhaps you could give me some help > >> > > >> > I'd like to put a shortcut on the C:\Users\Public\Desktop location > >> > pointing > >> > to C:\CPS\CPSAPP.exe > >> > > >> > Could you perhaps write that for me? At least then, i would understand > >> > it > >> > for future scripts. > >> > > >> > "Desmond Lee" wrote: > >> > > >> > > Give it a go and let us know if we could be of further help. > >> > > > >> > > > >> > > Thanks greatbarrier86. > >> > > > >> > > -- > >> > > http://www.leedesmond.com/weblog/ > >> > > > >> > > > >> > > > >> > > "greatbarrier86" wrote: > >> > > > >> > > > Desmond > >> > > > > >> > > > Thanks...but it still is slightly confusing to me. I think i can > >> > > > get it > >> > > > > >> > > > Thanks!! > >> > > > > >> > > > "Desmond Lee" wrote: > >> > > > > >> > > > > Yes. Take a look at a previous post if this helps. > >> > > > > > >> > > > > http://www.leedesmond.com/weblog/?p=60 > >> > > > > > >> > > > > Thanks. > >> > > > > -- > >> > > > > http://www.leedesmond.com/weblog/ > >> > > > > > >> > > > > > >> > > > > > >> > > > > "greatbarrier86" wrote: > >> > > > > > >> > > > > > Hi, > >> > > > > > > >> > > > > > is it possible to use Powershell to create a desktop shortcut > >> > > > > > icon to one of > >> > > > > > my company's programs. right now, i'm using a VB script to do > >> > > > > > it,but it would > >> > > > > > be better if i could get Powershell to do it. > |
My System Specs![]() |
| | #10 (permalink) |
| | Re: Creating shortcuts with PowerShell Marty Is it possible to use a variable that refers to the Public directory? i know $home refers to the current user directory, but what about the public one? "Marty List" wrote: > > Usually the Desktop folder is a subfolder of the user's profile, but not > always. It might be safer to ask the Shell (Explorer) for the current > user's Desktop path: > > $ShellApplication = New-Object –com Shell.Application > $DesktopFolderID = 0x10 > $DesktopFolderPath = > ($ShellApplication.namespace($DesktopFolderID)).Self.Path > > > "greatbarrier86" <greatbarrier86@discussions.microsoft.com> wrote in message > news:4F99C25F-0F7E-411B-8F2F-957E855E5610@microsoft.com... > > Wow...thank you. > > $home equals the Public Desktop folder? > > > > "Desmond Lee" wrote: > > > >> $wshshell = New-Object -ComObject WScript.Shell > >> $lnk = $wshshell.CreateShortcut("$home\Desktop\nameOfMyShortcut.lnk") > >> $lnk.TargetPath = "C:\CPS\CPSAPP.exe" > >> $lnk.Save() > >> > >> > >> I reckon you are using Vista? In any case, the $home variable will send > >> it > >> to the correct folder. > >> > >> Let us know if this helps. Good night! > >> > >> -- > >> http://www.leedesmond.com/weblog/ > >> > >> > >> > >> "greatbarrier86" wrote: > >> > >> > Desmond, > >> > > >> > I'm lost...i apologize. > >> > > >> > Perhaps you could give me some help > >> > > >> > I'd like to put a shortcut on the C:\Users\Public\Desktop location > >> > pointing > >> > to C:\CPS\CPSAPP.exe > >> > > >> > Could you perhaps write that for me? At least then, i would understand > >> > it > >> > for future scripts. > >> > > >> > "Desmond Lee" wrote: > >> > > >> > > Give it a go and let us know if we could be of further help. > >> > > > >> > > > >> > > Thanks greatbarrier86. > >> > > > >> > > -- > >> > > http://www.leedesmond.com/weblog/ > >> > > > >> > > > >> > > > >> > > "greatbarrier86" wrote: > >> > > > >> > > > Desmond > >> > > > > >> > > > Thanks...but it still is slightly confusing to me. I think i can > >> > > > get it > >> > > > > >> > > > Thanks!! > >> > > > > >> > > > "Desmond Lee" wrote: > >> > > > > >> > > > > Yes. Take a look at a previous post if this helps. > >> > > > > > >> > > > > http://www.leedesmond.com/weblog/?p=60 > >> > > > > > >> > > > > Thanks. > >> > > > > -- > >> > > > > http://www.leedesmond.com/weblog/ > >> > > > > > >> > > > > > >> > > > > > >> > > > > "greatbarrier86" wrote: > >> > > > > > >> > > > > > Hi, > >> > > > > > > >> > > > > > is it possible to use Powershell to create a desktop shortcut > >> > > > > > icon to one of > >> > > > > > my company's programs. right now, i'm using a VB script to do > >> > > > > > it,but it would > >> > > > > > be better if i could get Powershell to do it. > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| creating shortcuts | PowerShell | |||
| Creating and deleting shortcuts | VB Script | |||
| Need help creating shortcuts | VB Script | |||
| Vista not creating shortcuts? | Vista General | |||
| Creating shortcuts from PowerShell | PowerShell | |||