?
Solved

how to add a command line to my script

Posted on 2011-02-28
4
Medium Priority
?
1,014 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

777 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