Solved

how to add a command line to my script

Posted on 2011-02-28
4
983 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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Script to copy or move mouse-selected collection of files plus targets referenced by shortcuts (.lnk) The purpose of this article is to help illuminate the real challenges and options available (where they may exist) for utilizing simple scriptin…
Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 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