Jump to content
Sign in to follow this  
Markir

RunWait Problem

Recommended Posts

Hello,

what is wrong with this code line?

I want to have a different Destination "Ordner".

RunWait(@ComSpec & " /c ipconfig /all > & @ScriptDir & \ipconfig.log")

Share this post


Link to post
Share on other sites

Hello,

what is wrong with this code line?

I want to have a different Destination "Ordner".

RunWait(@ComSpec & " /c ipconfig /all > & @ScriptDir & \ipconfig.log")

<{POST_SNAPBACK}>

you are putting variables inside an string.. try:

RunWait(@ComSpec & " /c ipconfig /all > " & @ScriptDir & "\ipconfig.log")

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

Share this post


Link to post
Share on other sites

Hi,

now I have the following Code, but it doesn't function, there is no output:

RunWait(@ComSpec & " /c ipconfig /all > " & @ScriptDir & "\ipconfig.ini") 
$ipconfigfile = FileOpen(@ScriptDir & "\ipconfig.ini", 0)
$ipconfigline = FileReadLine($ipconfigfile)
While Not StringInStr($ipconfigline, 'Physikalische Adresse')
    $ipconfigline = FileReadLine($ipconfigfile)
WEnd
$MacAdresse = StringTrimLeft($ipconfigline, StringInStr($ipconfigline, ': ')+1)



$input10 = GUICtrlCreateInput ($MacAdresse,100,0,120)

Share this post


Link to post
Share on other sites

I have two questions about the Function Runwait:

1.)

What is wrong with this code? I want to add a route with the ip address of the inputfield

RunWait(@Comspec & ' /c " route add 10.0.0.0 mask 255.255.255.0 ' & $input& ' -p"',"",@SW_HIDE)

2.)

What is wrong with this code? I want to run the following:

Run(& $InstallPath & "\SDKTools\infotool.exe"' export rec=correl file= & @ScriptDir & '"\Backup_Datenbank\correl.txt"')

$installpath is declared in the program

Share this post


Link to post
Share on other sites

I have two questions about the Function Runwait:

1.)

What is wrong with this code? I want to add a route with the ip address of the inputfield

RunWait(@Comspec & ' /c " route add 10.0.0.0 mask 255.255.255.0 ' & $input& ' -p"',"",@SW_HIDE)

2.)

What is wrong with this code? I want to run the following:

Run(& $InstallPath & "\SDKTools\infotool.exe"' export rec=correl file= & @ScriptDir & '"\Backup_Datenbank\correl.txt"')

$installpath is declared in the program

<{POST_SNAPBACK}>

Are you using an editor that does SyntaxHighlighting like SciTE ? that would help you sorting out ' and " issues..

try these 2 lines to see if thats what you want:

RunWait(@Comspec & ' /c route add 10.0.0.0 mask 255.255.255.0 ' & $input& ' -p',"",@SW_HIDE)

Run($InstallPath & '\SDKTools\infotool.exe export rec=correl file="' & @ScriptDir & '\Backup_Datenbank\correl.txt"')

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

Share this post


Link to post
Share on other sites

Yes, I am using the editor SciTE !

Your Code doesn't add a route

<{POST_SNAPBACK}>

To debug issues like this its easiest to have a look what the command looks like that you are executing. so what does this show ?

MsgBox(0,'DEBUG',@Comspec & ' /c route add 10.0.0.0 mask 255.255.255.0 ' & $input & ' -p')

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

Share this post


Link to post
Share on other sites

This is the whole code:

#include <GUIConstants.au3>
Opt("GUICoordMode",2)
Opt("GUIResizeMode", 1)
Opt("GUIOnEventMode", 1)

$parent1 = GUICreate("Parent1")
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")





$input = GuiCtrlCreateinput("",10,10,120)

$ok1 = GUICtrlCreateButton ("OK",  10, 30, 50)
GUICtrlSetOnEvent(-1, "OKPressed")


GUISetState()

; Just idle around
While 1
    Sleep(10)
Wend

; END

Func OKPressed()
;RunWait(@Comspec & ' /c route add 10.0.0.0 mask 255.255.255.0 ' & $input& ' -p',"")
MsgBox(0,'DEBUG',@Comspec & ' /c route add 10.0.0.0 mask 255.255.255.0 ' & $input & ' -p')

 
EndFunc



Func SpecialEvents()
    
    Select
        Case @GUI_CTRLID = $GUI_EVENT_CLOSE
          ; MsgBox(0, "Close Pressed", "ID=" & @GUI_CTRLID & " WinHandle=" & @GUI_WINHANDLE)
            Exit
            
        Case @GUI_CTRLID = $GUI_EVENT_MINIMIZE
          ; MsgBox(0, "Window Minimized", "ID=" & @GUI_CTRLID & " WinHandle=" & @GUI_WINHANDLE)
            
        Case @GUI_CTRLID = $GUI_EVENT_RESTORE
          ; MsgBox(0, "Window Restored", "ID=" & @GUI_CTRLID & " WinHandle=" & @GUI_WINHANDLE)
            
    EndSelect
    
EndFunc

And the result with the debug Msgbox is:

C:\Windows\System32\cmd.exe /c route add 10.0.0.0 mask 255.255.255.0 3 -p

Ant the calue "3" is the input. but I have written 10.10.10.10 into the inputfield

Share this post


Link to post
Share on other sites

This is the whole code:

And the result with the debug Msgbox is:

C:\Windows\System32\cmd.exe /c route add 10.0.0.0 mask 255.255.255.0 3 -p

Ant the calue "3" is the input. but I have written 10.10.10.10 into the inputfield

<{POST_SNAPBACK}>

$input contains the HANDLE of the CONTROL ... NOT its value..

To get the value of the control you need to do a GUICtrlRead($input)....

Edited by JdeB

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

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...