You should add /c and backslashes and space to your strings for example
Func addEpson()
Local $EpsonSilent= "-f silent.properties"
Local $UpdateIP = "10.20.30.45"
If IsAdmin Then
RunWait(@ComSpec & ' /c "D:\Merchant\Connect\epson.exe" ' & $EpsonSilent, "", @SW_HIDE)
RunWait (@ComSpec & ' /c "D:\Merchant\Connect\copyfile.exe" ' & $UpdateIP, "", @SW_HIDE)
EndIf
EndFunc
;~ Another way allows you to change folder path if required
Func addEpson($sMasterFolderPath = 'D:\Merchant\Connect')
Local $sEpsonSilent= '"' & $sMasterFolderPath & '\epson.exe" -f silent.properties'
Local $sUpdateIP = '"' & $sMasterFolderPath & '\copyfile.exe" 10.20.30.45'
If IsAdmin Then
RunWait(@ComSpec & ' /c ' & $sEpsonSilent, "", @SW_HIDE)
RunWait(@ComSpec & ' /c ' & $sUpdateIP, "", @SW_HIDE)
EndIf
EndFunc
I only have a USB thumb drive but see what this does
#include <Array.au3>
_DrivesFromBusType("")
Func _DrivesFromBusType($sBus = Default)
Local $objWMIService = ObjGet("winmgmts:\\.\root\cimv2")
Local $colDiskDrives = $objWMIService.ExecQuery("SELECT * FROM Win32_DiskDrive")
If ($sBus = Default or Not $sBus) Then $sBus = "USB"
For $objDrive In $colDiskDrives
If $objDrive.InterfaceType <> $sBus then Continueloop
ConsoleWrite( "Physical Disk: " & $objDrive.Caption & " -- " & $objDrive.DeviceID & " (" & $objDrive.InterfaceType & ")" & @CRLF)
$strDeviceID = StringReplace($objDrive.DeviceID, "\", "\\")
ConsoleWrite( $objDrive.DeviceID & " = " & $objDrive.PNPDeviceID & @CRLF)
Local $colPartitions = $objWMIService.ExecQuery( "ASSOCIATORS OF {Win32_DiskDrive.DeviceID=""" & _
$strDeviceID & """} WHERE AssocClass = Win32_DiskDriveToDiskPartition" )
For $objPartition In $colPartitions
ConsoleWrite( "Disk Partition: " & $objPartition.DeviceID & @CRLF)
Local $colLogicalDisks = $objWMIService.ExecQuery( "ASSOCIATORS OF {Win32_DiskPartition.DeviceID=""" & _
$objPartition.DeviceID & """} WHERE AssocClass = Win32_LogicalDiskToPartition" )
For $objLogicalDisk In $colLogicalDisks
ConsoleWrite( "Logical Disk: " & $objLogicalDisk.DeviceID & @CRLF)
Next
Next
Next
EndFunc
Credit:
Also check out this thread
This is great - It's cool to see someone else interested in AS400 automation!
A few years ago I developed an application for my employer that automated iSeries and wrote a massive library to operate on these PCOMM classes. I found that using the AutScreenDesc class was a very reliable way of waiting for a screen by first describing it then calling the WaitForScreen() method. Alternatively, the WaitForString() and WaitForStringInRect() methods work just as well.
I also found the SetConnectionByHandle() method was a bit more reliable when dealing with multiple sessions.
I wish I could share the lib, but unfortunately it technically doesn't belong to me
Though IBM provides a wealth of knowledge on these classes here and even provide VB example code which makes it super easy to translate into AU3.