Sign in to follow this  
Followers 0
hispeed_mike

Something Easy to Solve - Send a $var to cmd prompt

4 posts in this topic

Hi,

Having trouble sending this variable as text to the command prompt window, thanks for the help

here is the code...

#include "ControlSendPlus.au3"

$var1 = InputBox("Machine ID", "Enter Machine ID ( EG: Computer Number 01 to 32")

Run (@COMSPEC)

Sleep (500)

ControlSendPlus ("C:\WINDOWS\system32\cmd.exe", "", "", "mkdir c+;\PrintJob{ENTER}", 0)

Sleep(1000)

ControlSendPlus ("C:\WINDOWS\system32\cmd.exe", "", "", "net use & $var1 &=c+;\Printjob{ENTER}", 0)

No problems sending the text but just problems with varaible just not being replaced with the sharename.

Thanks

Mike

Share this post


Link to post
Share on other sites



Hi,

Having trouble sending this variable as text to the command prompt window, thanks for the help

here is the code...

#include "ControlSendPlus.au3"

$var1 = InputBox("Machine ID", "Enter Machine ID ( EG: Computer Number 01 to 32")

Run (@COMSPEC)

Sleep (500)

ControlSendPlus ("C:\WINDOWS\system32\cmd.exe", "", "", "mkdir c+;\PrintJob{ENTER}", 0)

Sleep(1000)

ControlSendPlus ("C:\WINDOWS\system32\cmd.exe", "", "", "net use & $var1 &=c+;\Printjob{ENTER}", 0)

No problems sending the text but just problems with varaible just not being replaced with the sharename.

Thanks

Mike

Controlsend doesn't work with command prompt.

Try this

Run(@ComSpec & " /c " & 'command', "", @SW_HIDE)

Share this post


Link to post
Share on other sites

Controlsend doesn't work with command prompt.

Try this

Run(@ComSpec & " /c " & 'command', "", @SW_HIDE)

Hi,

I am using ControlSendPlus with command prompt, which works great. You will need the include to test. All I need to understand is how inside of a block of text that is needed to be sent do I declare the variable I input by the InputBox?

ControlSendPlus.au3

Share this post


Link to post
Share on other sites

Hi,

I am using ControlSendPlus with command prompt, which works great. You will need the include to test. All I need to understand is how inside of a block of text that is needed to be sent do I declare the variable I input by the InputBox?

Just tried to break down the delivery of the $var1 to it own ControlSendPlus line and it works...

Thanks for the reply...Sorry I didn't think of this one sooner....

Mike

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  
Followers 0