Jump to content

script works compiled exe does'nt


Recommended Posts

i have tried to write this script myself and cant work out why after i compile it it dosent work but when i run it from the script editor it works

run("cmd.exe")

send("!ipconfig")

send("{enter}")

this is working on my comp with v3.3.0.0 of autoit, compiled and in editor

Run("cmd.exe")
WinWaitActive("[CLASS:ConsoleWindowClass]")
send("!ipconfig")
send("{enter}")

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

You're doing it the hard way

Run(@ComSpec & " /c ipconfig")

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

You're doing it the hard way

Run(@ComSpec & " /c ipconfig")

You must be a fast reader :-)

That sure does flash by pretty quick.

I would suggest that the OP use a batch file...

:start

ipconfig /all

pause

goto start

...but then I would have to explain how to make a text file and rename it with the bat or cmd file extension. And considering how Microsoft protects users from themselves - I would have to also explain how to show the file extensions of known file types.

The "code" above loops. Kill the window with the mouse on the "X" or "Ctrl-c" it.

Name the batch file above something like IPconfig-all.bat

It will take up about 840 bytes on ye ole hard drive as a text file instead of 600,000+ bytes as an AutoIt exe file (w/o UPX).

Then you can make another batch file named something like RR.bat

ipconfig /release

ipconfig /renew

pause

ipconfig /all

pause

There is no loop in the "code" above.

You can add...

ipconfig /flushdns

... to the RR.bat file above - but only if you are actually running the DNS service, which I don't. I see no use for it.

And then there is the properties of the cmd window. I make it big enough to be useful when you have more than one NIC. Something like 120 characters by 55 characters.

Edit: Doh - welcome to the forum Lewis McCall.

:: goes grousing back to his corner ::

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

I was just showing him how to do it using @Comspec as opposed to opening the command window and then going through the rest of the crap (Send()s). If it were me, I would probably have sent it to StdOut as well. I don't see where a batch file would have been any better here especially with Pause

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

I was just showing him how to do it using @Comspec as opposed to opening the command window and then going through the rest of the crap (Send()s). If it were me, I would probably have sent it to StdOut as well. I don't see where a batch file would have been any better here especially with Pause

I understand you were showing a better way in AutoIt. I wasn't knocking your code. I was going for a bit of humor about you being a fast reader - I might not have succeeded.

Some things I wouldn't port to AutoIt. A simple batch file with pause is all that is needed to see the ipconfig info. Sometimes I'm just checking my IP, at other times I want to copy the default gateway to the clipboard. Most of the time, I have multiple NICs enabled and ipconfig /all works great via that batch file... no other coding needed.

My grousing was about how Windows' default settings make it hard to teach someone to make a batch file.

sb1920alk,

I knew about /k - but thanks for the opportunity to make a one letter post :-)

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

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