Jump to content

How to pass parameters another script


Recommended Posts

Dears

I want to pass more parameters to another script, but as below command can't work

How to do this?

 

Run(@ScriptDir & '\Determine.exe ' & $Poolname & $ComputerName, '', @SW_MINIMIZE)

Determine.exe code

Global $bDebug = True
If $bDebug Then Global $hOpen = FileOpen(@ScriptDir & '\Determine.log', 1)

If $CmdLine[0] > 0 Then
    If $bDebug Then _DebugLog('$CmdLineRaw = ' & $CmdLineRaw)

        Local $Filter = RunWait(@ComSpec & " /c " & @ScriptDir &'\HLK_Filter.bat')
    _Determine($CmdLineRaw)
EndIf

FileClose($hOpen)

Func _DebugLog($sString)
    FileWrite($hOpen, @YEAR & '\' & @MON & '\' & @MDAY & ' ' & @HOUR & ':' & @MIN & ':' & @SEC & ' :: ' & $sString & @CRLF)
EndFunc

Func _Determine($Poolname, $ComputerName )

Endfunc

 

 

Link to comment
Share on other sites

At first glance, I think the problem with your example is your _Determine function has two parameters, but you are trying to pass only one ($CmdLineRaw) in your If $CmdLine[0] statement.

Ini may be a good option, but you can search the forum for other Inter-Process Communication techniques (mailslot for example) if you don't want to have to rely on writing to the disk.

Link to comment
Share on other sites

The AutoIt INIWrite* and INIRead* functions will allow you write contents to and read from an INI text file respectively.  There are examples in the help file.

 

Link to comment
Share on other sites

  • 2 weeks later...

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