Jump to content

mcgill

Active Members
  • Posts

    54
  • Joined

  • Last visited

About mcgill

  • Birthday 11/07/1980

mcgill's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. I am trying to use the code below to pull certain field data from a WIM file, but it keeps returning empty fields. If I manually run the command or pump it to a text file I know it is working and the array is also not empty. For some reason don't know why _Stringbetween is not grabbing the value. Any help would be appreciated, thanks Func PollImageInfo($read, $y) Dim $nitem Dim $imageinfo = " " ; $read = GUICtrlRead($hApplySourceEdit) ;MsgBox(0, "DEBUG $read", $read) $sCmd = "imagex.exe" If $read = "" Then MsgBox(48, "Input required", "Please select the source") Else $sCmd = $sCmd & ' /info "' & $read & '"' EndIf ;MsgBox(0, "scmd", $sCmd) Dim $ret = Run(@ComSpec & " /c " & $sCmd & '"', @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $line = StdoutRead($ret) If $line = "" Then ExitLoop $imageinfo = $imageinfo & $line ;MsgBox(0, "RunDOS", $line) If @error Then ExitLoop WEnd _GUICtrlTreeView_DeleteAll($treeview) $aImageInfo = _StringBetween($imageinfo, "<NAME>", "</NAME>") If @error Then $aImageInfo = _ArrayCreate("<Empty>") $aImageDesc = _StringBetween($imageinfo, "<Description>", "</Description>") If @error Then $aImageDesc = _ArrayCreate("<Empty>") $aImageFileCount = _StringBetween($imageinfo, "<Filecount>", "</Filecount>") If @error Then $aImageFileCount = _ArrayCreate("<Empty>") $aImageSize = _StringBetween($imageinfo, "<TOTALBYTES>", "</TOTALBYTES>") If @error Then $aImageSize = _ArrayCreate("<Empty>") ;$aImageBuild = _StringBetween ( $imageinfo, "<Build>", "</Build>" ) ; If @error Then $aImageBuild = _ArrayCreate("<Empty>") $imagenumber = UBound($aImageInfo, 1) If @error Then $imagenumber = _ArrayCreate("<Empty>") $x = 0 Dim $nitem[$imagenumber] If $y = 0 Then ;MsgBox(0, "DEBUG", $y) Do $iName = $aImageInfo[$x] $iDesc = $aImageDesc[$x] $iFiles = $aImageFileCount[$x] $iSize = $aImageSize[$x] GUICtrlSetData($hInfoNewName, $iName) GUICtrlSetData($hInfoNewDesc, $iDesc) GUICtrlSetData($hInfoFileCount, $iFiles) GUICtrlSetData($hInfoFileSize, $iSize) $x = $x + 1 Until $x = $imagenumber $z = $x Else Do $iName = $aImageInfo[$x] $iDesc = $aImageDesc[$x] $iFiles = $aImageFileCount[$x] $iSize = $aImageSize[$x] GUICtrlSetData($hInfoNewName, $iName) GUICtrlSetData($hInfoNewDesc, $iDesc) GUICtrlSetData($hInfoFileCount, $iFiles) GUICtrlSetData($hInfoFileSize, $iSize) $x = $x + 1 Until $x = $y EndIf $iCount = $x GUICtrlSetData($hInfoNumber, $iCount) EndFunc ;==>PollImageInfo
  2. I got it to work, by adding ..\ before the EXE name, this allowed me to call on the compiled EXE by AutoIT3Wrapper #AutoIt3Wrapper_Res_File_Add=Name.exe Runwait("..\Name.exe)
  3. AutoIT3Wrapper: *************** Is it possible to compile EXE with options and add a EXE file within and call on it withint the AutoIT script? In the help file I see this: ******************************* ; Add extra files to the resources #AutoIt3Wrapper_Res_File_Add= ; Filename[,Section [,ResName[,LanguageCode]]] to be added. But can't get it to work on calling on the EXE within the compiled EXE
  4. Thank you UEZ, your assistance is much appreciated.
  5. Looking for a countdown timer to be used with applying certain installations prior to reaching zero/no time left. I am not looking for a countup function. With this function I would like to be able to add time to it incase a user wants to increase the countdown timer, example being countdown timer of 60 minutes/1 hour, user wants to increase by 60 minutes/1 hour. The only information I have come across on the forums is for minutes and seconds only. Any helps/assistance in the right direction would be great, thanks Example on forums: ******************* $new = TimerDiff ($timer) $new = (60*60*1000)-$new $seconds = Round ($new/1000) $newMin = Floor ($seconds/60) $newSec = Mod ($seconds, 60) If $newSec < 10 Then $newSec = "0"&$newSec $LabelTime = $newMin & ":" & $newSec GUICtrlSetData ($TimeLimit, $LabelTime)
  6. I have a issue with AutoIt passing credentials when trying to map a network drive. If I have manually open up a cmd.exe with an admin account and map a drive it maps with no problems. If I do a RunAs on the AutoIt exe or do a RunAsSet within the application it does not map the drive. If I do a RunAsSet calling on cmd.exe, manually type in the command to connect the network drive it maps the network drive.......one issue, if I go to view the mapped drive through explorer its not mapped and if I reload a cmd.exe with admin credentials the drive is not mapped anymore. I can map drives fine with my regular account, just seems AutoIt is not passing the correct credentials when performing what I need. This does not make sense to me why its not working, a little help would be greatly appreciated, thanks RUNASSET: local $user = "username" local $domain = @LogonDomain local $passwd = "password" RunAsSet($user, $domain, $passwd) Run ("cmd.exe") Also Tried: local $user = "username" local $domain = @LogonDomain local $passwd = "password" RunAsSet($user, $domain, $passwd) Run (@comspec & " /c net use s: \\server\root", @WindowsDir, @SW_MINIMIZE)
  7. When I run this code it works but when I run it with the statement I had or point to a patch file the msgbox is empty.
  8. Looks the same when I export to a file, is there a way to set width on a inputbox or msgbox so it displays correctly?
  9. k, now i got it to work to send my data to the msgbox, is there a way I can clean it up to make it look pretty with the titles? $hRun = Run ("C:\Documents and Settings\amcgill\Desktop\list.bat", "", @SW_SHOW, $STDOUT_CHILD) ; Read output $sOutput = "" While 1 $sOutput &= StdOutRead($hRun) If @error Then ExitLoop Sleep(50) WEnd ; Display results MsgBox(64, "Results", $sOutput)
  10. I need some help sending the data I get from the dos prompt to my msgbox, right now its pulling my temp files. I think my run line is screwed up. I want to run the sql line and then export the data to a msgbox. Any help would be great, thanks $hRun = Run (@comspec & " /c DIR osql -U sa -P -d Insync -Q " & $Sign & "sp_databases" & $Sign, @TempDir, @SW_SHOW, $STDOUT_CHILD) ; Read output $sOutput = "" While 1 $sOutput &= StdOutRead($hRun) If @error Then ExitLoop Sleep(50) WEnd ; Display results MsgBox(64, "Results", $sOutput)
  11. I would like to search for a string in a word document and once the string is found I would like to copy data that is a tab over from the search string. I do not see a Find function in the word.au3/udf, there is a FindandReplace. If anyone has done anything like this help would be greatly appreciated, thanks
  12. Is it possible to read data in a microsoft word( .doc ) file searching for specific criteria and then copy a line in the file where the data is found...export to a text file. I have been playing around with the word.au3 and there is a replace string but no find option. Has there been an update to the word.au3 or can anyone else give me a way of doing it, thanks
  13. Here is an example of getting the selected item from a listbox. I hope this is what you are looking for. #include <GUIConstants.au3> GLOBAL $MESSAGE = "The following buttons have been clicked" GUICreate("My GUI list",280, 100) ; will create a dialog box that when displayed is centered $Add=GUICtrlCreateButton ("Add", 0,0,75,25) $Clear=GUICtrlCreateButton ("Clear", 0,25,75,25) $MyList=GUICtrlCreateList ("buttons that have been clicked",75,0,205,110) GUICtrlSetLimit(-1,200) ; to limit horizontal scrolling GUICtrlSetData(-1,$MESSAGE) $DisplayText = GUICtrlCreateButton ("Display", 0,50,75,25) $Close=GUICtrlCreateButton ("Close", 0,75,75,25) GUISetState () $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $Add GUICtrlSetData($mylist,"You clicked button No1|") Case $msg = $Clear GUICtrlSetData($mylist,"") Case $msg = $DisplayText msgbox(4096,"TEST", GUICTRLRead($mylist)) Case $msg = $Close MsgBox(0,"", "the closing button has been clicked",2) Exit EndSelect Wend
  14. I have run into problems with windows xp. When I have users run this script it does not create the directory and copy the files. This works perfectly on a windows 2000 machine. What line of code am I missing for xp? Code below: #include <GUIConstants.au3> #include <file.au3> DirRemove("C:\Program Files\Service Desk\Avaya", 1) DirCreate("C:\Program Files\Service Desk\Avaya") $workingdir = @WorkingDir FileChangeDir("C:\Program Files\Service Desk\Avaya") FileCopy("\\Hosvr4\Docs\Service Desk\Avaya\Avaya.exe", "C:\Program Files\Service Desk\Avaya\Avaya.exe") FileCopy("\\Hosvr4\Docs\Service Desk\Avaya\avaya.bmp", "C:\Program Files\Service Desk\Avaya\avaya.bmp") FileCopy("\\Hosvr4\Docs\Service Desk\Avaya\CITY.txt", "C:\Program Files\Service Desk\Avaya\CITY.txt") FileCreateShortcut("C:\Program Files\Service Desk\Avaya\Avaya.exe", "C:\Documents and Settings\" & @UserName & "\Desktop\Avaya Password Reset.lnk") FileChangeDir($workingdir)
×
×
  • Create New...