?
Solved

how to add a command line to my script

Posted on 2011-02-28
4
Medium Priority
?
1,027 Views
Last Modified: 2012-05-11
i need to enter this command to my logon script.

\\copitrak\copitrakdesktop\CopitrakDesktop10.exe \\copitrak\copitrakdesktop /RELOAD

how do i go about doing this so that all my employees execute this when they log on to their workstations?

thanks

vbs-script.txt
0
Comment
Question by:miamiLAW
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:8ubterfug3
ID: 34998317
Does this work?

Run "\\copitrak\copitrakdesktop\CopitrakDesktop10.exe \\copitrak\copitrakdesktop /RELOAD"

Sub Run(ByVal sFile)
Dim shell
    Set shell = CreateObject("WScript.Shell")
    shell.Run Chr(34) & sFile & Chr(34), 1, false
    Set shell = Nothing
End Sub
0
 

Author Comment

by:miamiLAW
ID: 34998348
what do i do, copy and paste this anywhere in my script, quotes and all ?

Run "\\copitrak\copitrakdesktop\CopitrakDesktop10.exe \\copitrak\copitrakdesktop /RELOAD"

Sub Run(ByVal sFile)
Dim shell
    Set shell = CreateObject("WScript.Shell")
    shell.Run Chr(34) & sFile & Chr(34), 1, false
    Set shell = Nothing
End Sub
0
 
LVL 2

Expert Comment

by:8ubterfug3
ID: 34998788
The Sub portion can go at the bottom of your script. That is a sub routine that is called by the Run command. The line that starts with Run would go at the point in your script where you'd like to actually execute the exe file.
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 2000 total points
ID: 35001234
Hi, I think the extra quotes added by the Sub will cause that to fail.  You should get away with adding this:

Set objShell = CreateObject("WScript.Shell")
objShell.Run "cmd /c \\copitrak\copitrakdesktop\CopitrakDesktop10.exe \\copitrak\copitrakdesktop /RELOAD", 0, True

above this:

'=====================================
'Add On Code goes above this line ----

Regards,

Rob.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question