Jump to content
Sign in to follow this  
plzhelp

Little help ;)

Recommended Posts

plzhelp

Hey

I wanna do a RUN function with cmd line.

But.. I want to do it with reading a input..

How can I do that ?

Is it possible ?

Example:

Run('"notepad.exe" blablabalba & GuiCtrlRead($blablabla)')

?

Share this post


Link to post
Share on other sites
Jos

Sure, something like this:

Run('"notepad.exe" blablabalba ' & GuiCtrlRead($blablabla))

By the way: isn't your begging streak a little overkill?: Membername, Topic title and subtitle?

Just try to give your Topic titles a more meaningful text.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Donald8282

Here's a simple script like what you're talking about.

#include <GUIConstantsEx.au3>

GUICreate("Example", 200, 100)
GUISetState()

$Run = GUICtrlCreateInput("notepad.exe", 50, 10, 100, 20)
$Button = GUICtrlCreateButton("Run!", 60, 40, 70, 25)

While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        Exit
    Case $msg = $Button
        $RunGet = GUICtrlRead($Run)
        If $RunGet <> "" Then
            Run($RunGet)
            If @error Then
                MsgBox(16, "Error", "File not found")
            EndIf
        Else
            MsgBox(16, "Error", "No text entered")
        EndIf
    EndSelect
WEnd

Share this post


Link to post
Share on other sites
Rogue5099

Simple InputBox Example:

While 1
    $Run = InputBox("Example", "Enter .exe to Run", "notepad.exe")
    If @error = 1 Then Exit
    If Run($Run) = 0 Then MsgBox(16, "Error", "File not found")
WEnd

Donald8282's Example Simplified:

#include <GUIConstantsEx.au3>

GUICreate("Example", 200, 100)
GUISetState()

$Run = GUICtrlCreateInput("notepad.exe", 50, 10, 100, 20)
$Button = GUICtrlCreateButton("Run!", 60, 40, 70, 25)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button
            If Run(GUICtrlRead($Run)) = 0 Then MsgBox(16, "Error", "File not found")
    EndSwitch
WEnd
Edited by rogue5099

Share this post


Link to post
Share on other sites
Donald8282

Simple InputBox Example:

While 1
    $Run = InputBox("Example", "Enter .exe to Run", "notepad.exe")
    If @error = 1 Then Exit
    If Run($Run) = 0 Then MsgBox(16, "Error", "File not found")
WEnd

Donald8282's Example Simplified:

#include <GUIConstantsEx.au3>

GUICreate("Example", 200, 100)
GUISetState()

$Run = GUICtrlCreateInput("notepad.exe", 50, 10, 100, 20)
$Button = GUICtrlCreateButton("Run!", 60, 40, 70, 25)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button
            If Run(GUICtrlRead($Run)) = 0 Then MsgBox(16, "Error", "File not found")
    EndSwitch
WEnd

I was thinking of doing it that way but I had time on my hands and nothing to do =P

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  

×