PC Review


Reply
Thread Tools Rate Thread

How to copy shortcuts in a batch file

 
 
Diane Walker
Guest
Posts: n/a
 
      6th Mar 2008
Is there a way to setup a batch file to copy a shortcut to a user's desktop?
For example, I want to setup a batch file so that it will create an Excel
shortcut (Excel.exe) to a user's desktop.

Thanks.


 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      6th Mar 2008

"Diane Walker" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is there a way to setup a batch file to copy a shortcut to a user's
> desktop?
> For example, I want to setup a batch file so that it will create an Excel
> shortcut (Excel.exe) to a user's desktop.
>
> Thanks.
>


Do you want to copy and existing shortcut to the user's
desktop or to you want to create a brand new shortcut?


 
Reply With Quote
 
Diane Walker
Guest
Posts: n/a
 
      7th Mar 2008
I want to create a brand new shortcut and put it on the user's desktop.
Thanks.

"Pegasus (MVP)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> "Diane Walker" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Is there a way to setup a batch file to copy a shortcut to a user's
> > desktop?
> > For example, I want to setup a batch file so that it will create an

Excel
> > shortcut (Excel.exe) to a user's desktop.
> >
> > Thanks.
> >

>
> Do you want to copy and existing shortcut to the user's
> desktop or to you want to create a brand new shortcut?
>
>



 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      7th Mar 2008
Here is a VB Script example that will create a shortcut on
the user's desktop:
Set ObjShell = CreateObject("WScript.Shell")
strPath=ObjShell.SpecialFolders("Desktop")
Set objShortcut =ObjShell.CreateShortcut(strPath & "\Internet Explorer
Test.lnk")
objShortcut.TargetPath = "C:\Program Files\Internet Explorer\iexplore.exe"
objShortcut.arguments = "www.google.com"
objShortcut.Description = "Explorer Test"
objShortcut.Save

"Diane Walker" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>I want to create a brand new shortcut and put it on the user's desktop.
> Thanks.
>
> "Pegasus (MVP)" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>
>> "Diane Walker" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > Is there a way to setup a batch file to copy a shortcut to a user's
>> > desktop?
>> > For example, I want to setup a batch file so that it will create an

> Excel
>> > shortcut (Excel.exe) to a user's desktop.
>> >
>> > Thanks.
>> >

>>
>> Do you want to copy and existing shortcut to the user's
>> desktop or to you want to create a brand new shortcut?
>>
>>

>
>



 
Reply With Quote
 
Diane Walker
Guest
Posts: n/a
 
      8th Mar 2008
Thank you very much for taking time to this for me. I have to ask you a
dumb question. Do I copy the script to the notepad and save the file as
executable such as install.bat? I am not sure how to execute the script.

Thanks.

Diane

"Pegasus (MVP)" <(E-Mail Removed)> wrote in message
news:e$(E-Mail Removed)...
> Here is a VB Script example that will create a shortcut on
> the user's desktop:
> Set ObjShell = CreateObject("WScript.Shell")
> strPath=ObjShell.SpecialFolders("Desktop")
> Set objShortcut =ObjShell.CreateShortcut(strPath & "\Internet Explorer
> Test.lnk")
> objShortcut.TargetPath = "C:\Program Files\Internet Explorer\iexplore.exe"
> objShortcut.arguments = "www.google.com"
> objShortcut.Description = "Explorer Test"
> objShortcut.Save
>
> "Diane Walker" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> >I want to create a brand new shortcut and put it on the user's desktop.
> > Thanks.
> >
> > "Pegasus (MVP)" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >>
> >> "Diane Walker" <(E-Mail Removed)> wrote in message
> >> news:(E-Mail Removed)...
> >> > Is there a way to setup a batch file to copy a shortcut to a user's
> >> > desktop?
> >> > For example, I want to setup a batch file so that it will create an

> > Excel
> >> > shortcut (Excel.exe) to a user's desktop.
> >> >
> >> > Thanks.
> >> >
> >>
> >> Do you want to copy and existing shortcut to the user's
> >> desktop or to you want to create a brand new shortcut?
> >>
> >>

> >
> >

>
>



 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      8th Mar 2008
You save it to c:\CreateShortcut.vbs (for example) and invoke
it with this command:

cscript //nologo c:\CreateShortcut.vbs


"Diane Walker" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thank you very much for taking time to this for me. I have to ask you a
> dumb question. Do I copy the script to the notepad and save the file as
> executable such as install.bat? I am not sure how to execute the script.
>
> Thanks.
>
> Diane
>
> "Pegasus (MVP)" <(E-Mail Removed)> wrote in message
> news:e$(E-Mail Removed)...
>> Here is a VB Script example that will create a shortcut on
>> the user's desktop:
>> Set ObjShell = CreateObject("WScript.Shell")
>> strPath=ObjShell.SpecialFolders("Desktop")
>> Set objShortcut =ObjShell.CreateShortcut(strPath & "\Internet Explorer
>> Test.lnk")
>> objShortcut.TargetPath = "C:\Program Files\Internet
>> Explorer\iexplore.exe"
>> objShortcut.arguments = "www.google.com"
>> objShortcut.Description = "Explorer Test"
>> objShortcut.Save
>>
>> "Diane Walker" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>> >I want to create a brand new shortcut and put it on the user's desktop.
>> > Thanks.
>> >
>> > "Pegasus (MVP)" <(E-Mail Removed)> wrote in message
>> > news:(E-Mail Removed)...
>> >>
>> >> "Diane Walker" <(E-Mail Removed)> wrote in message
>> >> news:(E-Mail Removed)...
>> >> > Is there a way to setup a batch file to copy a shortcut to a user's
>> >> > desktop?
>> >> > For example, I want to setup a batch file so that it will create an
>> > Excel
>> >> > shortcut (Excel.exe) to a user's desktop.
>> >> >
>> >> > Thanks.
>> >> >
>> >>
>> >> Do you want to copy and existing shortcut to the user's
>> >> desktop or to you want to create a brand new shortcut?
>> >>
>> >>
>> >
>> >

>>
>>

>
>



 
Reply With Quote
 
Diane Walker
Guest
Posts: n/a
 
      8th Mar 2008
Thanks very much.

"Pegasus (MVP)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You save it to c:\CreateShortcut.vbs (for example) and invoke
> it with this command:
>
> cscript //nologo c:\CreateShortcut.vbs
>
>
> "Diane Walker" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Thank you very much for taking time to this for me. I have to ask you a
> > dumb question. Do I copy the script to the notepad and save the file as
> > executable such as install.bat? I am not sure how to execute the

script.
> >
> > Thanks.
> >
> > Diane
> >
> > "Pegasus (MVP)" <(E-Mail Removed)> wrote in message
> > news:e$(E-Mail Removed)...
> >> Here is a VB Script example that will create a shortcut on
> >> the user's desktop:
> >> Set ObjShell = CreateObject("WScript.Shell")
> >> strPath=ObjShell.SpecialFolders("Desktop")
> >> Set objShortcut =ObjShell.CreateShortcut(strPath & "\Internet Explorer
> >> Test.lnk")
> >> objShortcut.TargetPath = "C:\Program Files\Internet
> >> Explorer\iexplore.exe"
> >> objShortcut.arguments = "www.google.com"
> >> objShortcut.Description = "Explorer Test"
> >> objShortcut.Save
> >>
> >> "Diane Walker" <(E-Mail Removed)> wrote in message
> >> news:%(E-Mail Removed)...
> >> >I want to create a brand new shortcut and put it on the user's

desktop.
> >> > Thanks.
> >> >
> >> > "Pegasus (MVP)" <(E-Mail Removed)> wrote in message
> >> > news:(E-Mail Removed)...
> >> >>
> >> >> "Diane Walker" <(E-Mail Removed)> wrote in message
> >> >> news:(E-Mail Removed)...
> >> >> > Is there a way to setup a batch file to copy a shortcut to a

user's
> >> >> > desktop?
> >> >> > For example, I want to setup a batch file so that it will create

an
> >> > Excel
> >> >> > shortcut (Excel.exe) to a user's desktop.
> >> >> >
> >> >> > Thanks.
> >> >> >
> >> >>
> >> >> Do you want to copy and existing shortcut to the user's
> >> >> desktop or to you want to create a brand new shortcut?
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch file copy =?Utf-8?B?RXJ1ZGl0ZUJvbm5pZQ==?= Windows Vista General Discussion 1 19th Sep 2007 09:34 PM
batch script to copy file =?Utf-8?B?b2tuYW1v?= Windows XP General 3 19th Jul 2006 08:12 PM
Batch file to delete existing shortcuts ano1optimist Microsoft Windows 2000 CMD Promt 3 26th May 2006 01:28 PM
batch file to copy _ Microsoft Windows 2000 2 23rd Jan 2004 09:54 PM
Batch File to Copy DB Sharon Microsoft Access 1 31st Oct 2003 07:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:53 PM.