Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/13/2017 in Posts

  1. Subz

    Command line

    You can then use something like this: addEpson('10.20.30.45') Func addEpson($sUpdateIP, $sMasterFolderPath = 'D:\Merchant\Connect') If FileExists($sMasterFolderPath) = 0 Then Return 1 Local $sEpsonSilent= '"' & $sMasterFolderPath & '\epson.exe" -f silent.properties' Local $sEpsonUpdate = '"' & $sMasterFolderPath & '\copyfile.exe" ' & $sUpdateIP If IsAdmin Then RunWait(@ComSpec & ' /c ' & $sEpsonSilent, "", @SW_HIDE) RunWait(@ComSpec & ' /c ' & $sEpsonUpdate, "", @SW_HIDE) EndIf EndFunc
    1 point
  2. Subz

    Command line

    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
    1 point
  3. Something like this? #include <Array.au3> Local $s_TECHID = GetTechID() MsgBox(0,'', $s_TECHID) Func GetTechID() Local $as_IniRead = IniReadSection(@ScriptDir & '\settings.ini', 'Users') If IsArray($as_IniRead) Then Return _ArrayToString($as_IniRead, '|', 1, -1, '|', 0, 0) EndFunc ;==>GetTechID
    1 point
  4. You could do something like this. #include <Array.au3> Local $i = 1, $sRegKey = "HKLM\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}", $sSubKey, $aSubKey[1] While 1 $sSubKey = RegEnumKey($sRegKey, $i) If @error Then ExitLoop If StringLen($sSubKey) = 4 Then _ArrayAdd($aSubKey, $sRegKey & "\" & $sSubKey) $i += 1 WEnd $aSubKey[0] = UBound($aSubKey) - 1 _ArrayDisplay($aSubKey) MsgBox(48, "Last Reg Key", $aSubKey[$aSubKey[0]])
    1 point
  5. 1 point
  6. 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
    1 point
  7. IErrors

    AS400 tasks automation

    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.
    1 point
×
×
  • Create New...