Jump to content

Executing code from input box


Medic873
 Share

Recommended Posts

So I have a question I have never needed to cross this bridge but it finally came up at work today. I need to execute some code that is going be inputed from a inputbox. 

 

For example

 

[script]

msgbox("Hello", "Hello");

$code = inputbox("hello", "hello");

;Then right here it would take the variable $code and run its code that was just entered through the input box. Does tamake sense.

[/script]

Link to comment
Share on other sites

Here also another way:

Local $sCommand = InputBox("Execute by '/AutoIt3ExecuteLine'", "Enter one line of AutoIt code", 'MsgBox(0, "hello", "hello")')
$sCommand = '"' & StringReplace($sCommand, '"', '""') & '"'
Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & $sCommand)

 

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

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