Reload_2006 Posted August 29, 2006 Posted August 29, 2006 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!!!
Moderators SmOke_N Posted August 29, 2006 Moderators Posted August 29, 2006 (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 August 29, 2006 by SmOke_N 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.
Confuzzled Posted August 29, 2006 Posted August 29, 2006 Are you looking for _GetIP() or @IPAddress1?
Moderators SmOke_N Posted August 29, 2006 Moderators Posted August 29, 2006 Are you looking for _GetIP() or @IPAddress1?Oops, nice catch Confuzzled. 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.
Reload_2006 Posted August 30, 2006 Author Posted August 30, 2006 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!!!!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now