• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 419
  • Last Modified:

Using a VB Script to execute command line functions

Hello all.  Please note: I am a script neophyte.  I have been working with a software vendor that provides tools to execute commands against their system.  The commands are entered from a cmd window on a 2008r2 server.  The problem is that we have a large quantity of updates that would require a hand typed entry for each one.  I would like to create a script to run that would reference a csv file containing each of the line variables.
The commands are executed in this fashion from the command line:
C:\servercommand setfunction variable1 variable2 note1,note2
(each part is seperated by a space with the exception of the notes.. The notes can be multiple items seperated by a comma and exist as the last item in a string)

I would envision a file that is referenced that would look like this
variable1 variable2 note1,note2
variable3 variable4 note3,note4

Is there anyone that could provide a novice like me with a jump-start to have a script that would start the process with the 'servercommand setfunction' and then call the individual lines to be included as part of the script?

Please let me know if you need clarification.

Thank you in advance.
0
kgadams
Asked:
kgadams
  • 2
1 Solution
 
Bill PrewCommented:
Since you have to put the commands to be executed in a file anyway, why not make it a BAT file, and then just execute that?

@echo off
C:\servercommand setfunction variable1 variable2 note1,note2
C:\servercommand setfunction variable1 variable2 note1,note2
C:\servercommand setfunction variable1 variable2 note1,note2
C:\servercommand setfunction variable1 variable2 note1,note2

Open in new window

~bp
0
 
kgadamsAuthor Commented:
Hello Forrest... Meet trees...

Thanks for taking me back to a more simple view... I guess I was too close to the idea of a script.  The BAT works great..

I will just add a set path and then I will just have lines with the command and variable in it.

Thanks again for your contribution..
0
 
Bill PrewCommented:
Very welcome, glad that worked out.

~bp
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now