?
Solved

Using a VB Script to execute command line functions

Posted on 2013-11-06
3
Medium Priority
?
416 Views
Last Modified: 2013-11-06
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
Comment
Question by:kgadams
[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
3 Comments
 
LVL 56

Accepted Solution

by:
Bill Prew earned 1500 total points
ID: 39628123
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
 

Author Comment

by:kgadams
ID: 39628211
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
 
LVL 56

Expert Comment

by:Bill Prew
ID: 39628443
Very welcome, glad that worked out.

~bp
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month13 days, 3 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