JeffQOOQAAA

How to pass parameters another script

6 posts in this topic

#1 ·  Posted

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

 

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

You Can Just Create A Ini File And Pass Ini File As Parameter and in ini file you can specify more parameters

Share this post


Link to post
Share on other sites

#3 ·  Posted

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.

Share this post


Link to post
Share on other sites

#4 ·  Posted

@spudw2k @n3wbie

Sorry, could you help to me how to use  Ini file?

lni can pass  more parameters to another .au3?

 

Due to I have to .au3 need to pass parameters

Share this post


Link to post
Share on other sites

#5 ·  Posted

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.

 

Share this post


Link to post
Share on other sites

#6 ·  Posted

Have you deliberately concatenated $Poolname and $ComputerName or should you have a delimiter between them?

Just curious what is the value of each of them during runtime?

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