Jump to content

rvn

Active Members
  • Posts

    80
  • Joined

  • Last visited

Profile Information

  • Location
    Indonesia
  • Interests
    New things...

rvn's Achievements

Wayfarer

Wayfarer (2/7)

1

Reputation

  1. ok,,, lets say u can unmount isos before installing your program, and user use it and ofcourse nothing problem with it...then this is the limit, user can use your program if he/she always remember to unmount isos... dont you think so?! cheer Edit : typo
  2. its rvn, not Wayfarer ;P Need proper checking then... example... $WinTitle = "Windows Title" If WinExists($WinTitle) Then ;check if windows exist WinActivate($WinTitle) ;activate windows WinWaitActive($WinTitle) ;wait for windows to activated If WinActive($WinTitle) Then ;confirm if windows active Send("{UP}") Else MsgBox(0,"Warning","Windows not active!") EndIf Else MsgBox(0,"Warning","Windows not exist!") EndIf posting your code is a good thing,,, so the other can help.
  3. but even if it changed,,, thats not solution for it,,, must be another way
  4. DriveGetDrive('CDROM'),,, also included virtual CDROM... its annoying somehow.
  5. Welcome to Autoit forum help file can help you alot... "Sends simulated keystrokes to the active window." the real question is,,, how to activate the hidden window?! easy solusion,,, activate your IE,, then send key... or "send" is not what you looking for... check also IE UDF, ControlSend... cheer
  6. first,,, test ur client and server in same computer without using vmware. if ok,,, test it in multiple computer or using vmware. if not ok,,, its connection problem for sure... check your vmware network type,,, also check your firewall... if still not ok,,, are u sure thats a client-server app?! cheer
  7. Yup, now i know... I'll leave the old script... You know,,, beginner thing Thanx btw
  8. Nicely executed guinness,,, more effisient script there That StringRegExp,,, i know my fault This line inside your function, confius me little bit $sINIFilePath = @ScriptDir & 'INIFile.ini' And here, i change your script for my need,,, i'll keep it ... Hope someone also benefit from it. #include ;_IPConfig_To_INI("C:test.ini") _IPConfig_To_INI() Func _IPConfig_To_INI($sINIFilePath = "") Local $iPID = Run(@ComSpec & ' /c ipconfig /all', @SystemDir, @SW_HIDE, $STDOUT_CHILD + $STDERR_CHILD), $sOutput = '' While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd ;added If $sINIFilePath = "" Then $sINIFilePath = @ScriptDir & 'Ipconfig.ini' FileDelete($sINIFilePath) Local $aArray = StringSplit(StringStripCR($sOutput), @LF), $iSplitSection = 0, $sData = '', $sKey = '', $sSection = '', $sValue = '' $sOutput = '' ; Empty the StdoutRead variable. For $i = 1 To $aArray[0] If StringStripWS($aArray[$i], 8) = '' Then ContinueLoop EndIf If StringLeft($aArray[$i], 1) = ' ' Then ; Value $iSplitSection = StringInStr($aArray[$i], ':', 2) ; Find the first location of ':' $sKey = StringStripWS(StringLeft(StringLeft($aArray[$i], $iSplitSection), StringInStr($aArray[$i], '.', 2) - 1), 3) ; INI Key $sValue = StringStripWS(StringTrimLeft($aArray[$i], $iSplitSection), 3) ; INI Value If StringStripWS($sKey, 8) = '' Then $sData = StringTrimRight($sData, StringLen(@LF)) & ';' & $sValue & @LF ; For those values that are DNS servers. I chose to use ';' as the delimiter. ContinueLoop EndIf $sData &= $sKey & '=' & $sValue & @LF ; Add the key and value to the following section. Else ; Section If $sSection <> '' And $sData <> '' Then IniWriteSection($sINIFilePath, $sSection, $sData) ; Write the section to the INI file. $sOutput &= '[' & $sSection & ']' & @LF & $sData ; Add to the return variable. $sData = '' EndIf $sSection = StringStripWS($aArray[$i], 3) $sSection = StringTrimRight($sSection, Number(StringRight($sSection, 1) = ':')) ; Section EndIf Next Return $sOutput EndFunc ;==>_IPConfig_To_INI
  9. Amazing thanx
  10. Nice script MrCreatoR Want to test it, but cant download it. Error message "Sorry, you don't have permission for that!"
  11. Attention : for beginner only Not everyone master Regular Expression right. A function that run ipconfig in background, then parsing it to simple ini file. Ipconfig_to_ini() Func Ipconfig_to_ini($pLogName = "", $pLogDir = "", $pIniFileTarget = "") Local $SECTION,$KEY,$VALUE,$i If $pLogName = "" Then $pLogName = "ipconfig.log" If $pLogDir = "" Then $pLogDir = @ScriptDir If $pIniFileTarget = "" Then $pIniFileTarget = @ScriptDir & "ipconfig.ini" FileDelete($pIniFileTarget) RunWait(@Comspec & " /c ipconfig /all > " & $pLogName, $pLogDir , @SW_HIDE) If @error Then Return 0 Local $file = FileOpen($pLogDir & "" & $pLogName, 0) Local $line ; Check if file opened for reading OK If $file = -1 Then Return 0 EndIf While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop ;MsgBox(0, "Line read:", $line) If $line = "" Then Else If StringLeft($line,1) = " " Then ;key If StringLeft($line,9) = " " Then ;value $VALUE = IniRead($pIniFileTarget,$SECTION,$KEY,"") ;ConsoleWrite($VALUE & @CRLF) $VALUE = $VALUE & " " & StringStripWS($line,1+2) ;ConsoleWrite($VALUE & @CRLF) Else ;key If StringRegExp($line,":") = 1 Then ; [key : value] $string = StringSplit($line,":") $KEY = StringStripWS($string[1],1+2) $KEY = StringReplace($KEY,".","") If $string[0] = 2 Then $VALUE = StringStripWS($string[2],1+2) Else $VALUE = "" For $i = 2 To $string[0] $VALUE = $VALUE & $string[$i] & ":" ;ConsoleWrite($VALUE & @CRLF) Next $VALUE = StringTrimRight($VALUE,1) EndIf Else $VALUE = IniRead($pIniFileTarget,$SECTION,$KEY,"") ;ConsoleWrite($VALUE & @CRLF) $VALUE = $VALUE & " " & StringStripWS($line,1+2) ;ConsoleWrite($VALUE & @CRLF) EndIf EndIf IniWrite($pIniFileTarget,$SECTION,$KEY,$VALUE) Else ; section $line = StringStripWS($line,1 +2) If StringRight($line,1) = ":" Then $line = StringTrimRight($line,1) $SECTION = $line EndIf EndIf Wend FileClose($file) FileDelete($pLogDir & "" & $pLogName) Return 1 EndFunc Simple but work,,, at least for me Note : more than one value, saved in ini with space delimiter (example : multiple DNS Servers). Thanx Note : Scroll down for updated script!
  12. @Edgaras if u dont mind, please post your script,,, let the others help u Try this "compile", check "Add required constant...", click button "Save Only"...
  13. here another script, search multiple ekstention in a folder, maybe it can help search_all_eks("D:Test_Dir","txt,log",1) Func search_all_eks($sPath,$sEks,$sShow = 0) Local $search,$file,$result = "",$attrib,$eks,$i,$curEks,$found = 0,$curEksSplit $eks = StringSplit($sEks,',') $search = FileFindFirstFile($sPath & '*.*') If $search = -1 Then Return "" EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $attrib = FileGetAttrib($sPath & '' & $file) If @error Then Else If StringInStr($attrib, "D") Then $result = $result & search_all_eks($sPath & '' & $file,$sEks,$sShow) Else $found = 0 $curEksSplit = StringSplit($file,'.') $curEks = $curEksSplit[$curEksSplit[0]] For $i = 1 To $eks[0] If $curEks = $eks[$i] Then $found = 1 ExitLoop Else $found = 0 EndIf Next If $found = 1 Then If $sShow = 1 Then ConsoleWrite('+> ' & $sPath & '' & $file & @CRLF) $result = $result & $sPath & '' & $file & '|' Else ;ConsoleWrite('-> ' & $sPath & '' & $file & @CRLF) EndIf EndIf EndIf ;$result = $result & $file & '|' ;MsgBox(4096, "File:", $file) WEnd FileClose($search) Return $result EndFunc
  14. here example from help file with simple change ; Shows the filenames of all files in the current directory. $dir = "C:" $files = "*.txt" $search = FileFindFirstFile($dir & $files) ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop ;FileDelete($dir & $file) ;MsgBox(4096, "File:", $file) ConsoleWrite($dir & $file & @CRLF) WEnd ; Close the search handle FileClose($search)
  15. must be something with that $delimiter...
×
×
  • Create New...