Jump to content
Sign in to follow this  

Adding a Varible in to run several CMD's in one open window

Recommended Posts

Hello all. THanks for all the Help. I have a question about how to add in a varible when I am trying to run mutiple cmd's in one open window.

I found a way to run a few lines in the same window But I can't fiqure out how to add a command with a varible. In the following how would I

add say "Ping " $Current IP and make it work?

CMD = 'Echo 1 && ' & _

'Echo 2 && ' & _

'Echo 3 && ' & _

'Echo 4 && ' & _

'ipconfig /all'

RunWait('"' & @ComSpec & '" /k ' & $CMD, @SystemDir)

Share this post

Link to post
Share on other sites

Those aren't really a few lines, it's still a single line statement with multiple commands.

It's better to just have your script write a batch file and execute it using the run command.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...