Advertisement

04.08.2008 at 07:04AM PDT, ID: 23304604 | Points: 250
[x]
Attachment Details

New some scripting help

Asked by Geisrud in Scripting Languages

Tags: vbs, scripting, copy file

I'm a complete novice at scripting and could use some help.  I've found and adjusted the attached script and it does 90% of what I need it to do.  The file is currently saved to my desktop as file.vbs

My end goal is to create a desktop shortcut on a computer and have it use a certain icon of my choice.  So far I can create the icon and use the icon - assuming the icon is where I want it to be.  

Still missing is getting my icon to where it needs to be.

The short version: I need to add to the attached script, language to copy an icon file from here: "\\server\folder\file.ico"  to here:"c:\system32\windows\file.ico

Much thanks.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
Option Explicit
Dim objShell, objDesktop, objLink
Dim strAppPath, strWorkDir, strIconPath
 
' --------------------------------------------------
' Here are the variables that to change if you are making a 'real' script
 
strWorkDir ="C:\windows"
strAppPath = "https://www.campusship.ups.com/cship/create"
strIconPath = "%SystemRoot%\system32\ups.ico"
 
 
Set objShell = CreateObject("WScript.Shell")
objDesktop = objShell.SpecialFolders("Desktop")
Set objLink = objShell.CreateShortcut(objDesktop & "\UPS CampusShip.lnk")
 
' ---------------------------------------------------
' Section which adds the shortcut's key properties
 
objLink.Description = "UPS CampusShip"
objLink.IconLocation = strIconPath
objLink.TargetPath = strAppPath
objLink.WindowStyle = 3
objLink.WorkingDirectory = strWorkDir
objLink.Save
 
WScript.Quit
 
' End of creating a desktop shortcut
MakeDesktopShortcut "Shortcut to UPS CampusShip", "https://www.campusship.ups.com/cship/create"
[+][-]04.08.2008 at 08:58AM PDT, ID: 21306546

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.08.2008 at 11:16AM PDT, ID: 21307984

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.08.2008 at 11:24AM PDT, ID: 21308063

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.08.2008 at 03:23PM PDT, ID: 21310194

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.09.2008 at 05:58AM PDT, ID: 21314344

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.09.2008 at 06:05AM PDT, ID: 21314411

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 09:01AM PDT, ID: 21412465

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 09:42AM PDT, ID: 21412943

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 11:17AM PDT, ID: 21413876

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 12:08PM PDT, ID: 21414370

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906