Jump to content

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


Recommended Posts

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!!!

Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...