Sign in to follow this  
Followers 0
Reload_2006

This one should be quick for you guys, but I can't figure it out for teh life of me.

5 posts in this topic

Ok, I'm trying to write a script that will input the local machine's IP address into the end of the cmd. For instance, I want to run c:\windows\temp\program.cmd <local machine IP address>. The program is a cmd file not an exe file. I'm trying to run this on a Windows 2000 machine and this is what I've tried to run with no success:

run(comspec & " /c " & "c:\windows\temp\program.cmd" & @ipaddress)

Well the command prompt comes up and close immediately without running anything. Obviously there is something wrong with my code, but I have no idea what. I've done searches on the forum and I'm been trying to figure it out for what seems like forever. Can someone please give me a hand?

Thanks!!!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

to keep the command promp open, try running it with /k instead of /c. You also may want to try putting a space after .cmd " & @ipaddress (sure you don't want _GetIP()?)

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Are you looking for _GetIP() or @IPAddress1?

Share this post


Link to post
Share on other sites

Are you looking for _GetIP() or @IPAddress1?

Oops, nice catch Confuzzled.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

As always guys, thanks for all your help. SmOke_N, I feel like an idiot now. I just needed a space after .cmd and it worked great with that little modification.

Thanks again guys!!!!

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