Leaderboard
Popular Content
Showing content with the highest reputation on 11/21/2013 in all areas
-
If Not $Me.AllUsersPhoneBook.Entries.Contains($EntryName) Then Global $entry = $RasEntry.CreateDialUpEntry($EntryName, $PhoneNumber, $RasDevice.GetDeviceByName("(PPPOE)", $RasDeviceType.PPPoE) $Me.AllUsersPhoneBook.Entries.Add($entry) EndIf Best bet without having seen the rest of the code. And without any description what you are talking about.2 points
-
New SciTE4AutoIt3 available with SciTE v3.3.7
JLogan3o13 reacted to Melba23 for a topic
francoiste, Only Admin, Devs and Mods can post in that section, so it is far from "suitable" for hosting a thread such as this. And, because Jos is far too nice to say so and I have had a bastard of a week, as a relative newcomer why not just appreciate the work that he and others have put into creating the SciTE4Autoit3 package for the whole community rather than continually moaning that it is not exactly as YOU want it? M231 point -
Silent installation of software with installShield Setup
ashvin reacted to JLogan3o13 for a topic
Yes, you can look at the IniRead section in the help file for some examples.1 point -
help: copy file to folder
clicklogin1 reacted to MHz for a topic
; set paths $source = 'C:\daily mail' $destination = 'D:\daily mail' ; set regex pattern which returns the folder in the group $pattern = '.*_(.*?)_\d+\.xls\Z' ; check if paths exist For $1 In StringSplit($source & '|' & $destination, '|', 2); no count If Not FileExists($1) Then MsgBox(0x40030, @ScriptName, '"' & $1 & '" does not exist' & @CRLF) Exit 1 EndIf Next ; change to source directory If FileChangeDir($source) Then ; open a handle to find xls files $handle_find = FileFindFirstFile('*.xls') ; check if the handle is valid If $handle_find = -1 Then MsgBox(0x40030, @ScriptName, 'No xls files found') Exit 2 EndIf ; While 1 ; look for the next file $file_found = FileFindNextFile($handle_find) If @error Then ExitLoop ; check the file name with this pattern which returns the group in the name $folder = StringRegExpReplace($file_found, $pattern, '$1') ; if replacements occurred and folder is something If @extended And $folder Then ; if destination file exists then restart the loop If FileExists($destination & '\' & $folder & '\' & $file_found) Then ContinueLoop EndIf ; create the destination\folder If DirCreate($destination & '\' & $folder) Then ; copy the file to the destination\folder If Not FileCopy($file_found, $destination & '\' & $folder & '\') Then ConsoleWriteError('Failed to copy "' & $file_found & '"' & @CRLF) EndIf Else ConsoleWriteError('Failed to create folder "' & $folder & '"' & @CRLF) EndIf Else ConsoleWriteError('File "' & $file_found & '" did not match the pattern' & @CRLF) EndIf WEnd ; close the find xls files handle FileClose($handle_find) Else MsgBox(0x40030, @ScriptName, 'Unable to change working directory to "' & $source & '"' & @CRLF) EndIf Updated to match1 point -
help: copy file to folder
clicklogin1 reacted to NewPlaza for a topic
Are those folders the only 4 folders you will be working with?1 point -
try this if Not $EXEpath = 0 Then or.... From the help file. Local $message = "Hold down Ctrl or Shift to choose multiple files." Local $var = FileOpenDialog($message, @WindowsDir & "\", "Images (*.jpg;*.bmp)", 1 + 4) If @error Then MsgBox(4096, "", "No File(s) chosen") Else $var = StringReplace($var, "|", @CRLF) MsgBox(4096, "", "You chose " & $var) EndIf1 point
-
Silent installation of software with installShield Setup
ashvin reacted to JLogan3o13 for a topic
Hi, ashvin, welcome to the forum. If the installation is an InstallShield setup, that means it is really an MSI file wrapped in a setup.exe. There are a couple of things you can try: First and foremost I would try to extract the MSI and just run that. To do this, launch the setup.exe, click Next until you get to the last screen before installation. Then, look in your temp folder. You should see the MSI file and any supporting files. Copy these out, then cancel the installation. Once you have the MSI, you can run it in silent mode easily, doing something like this: ShellExecuteWait("msiexec.exe", "/i <path to msi> /qn") Some newer InstallShield-wrapped applications have a flag set that will only let you run the installation from the setup.exe file. If this is the case, you can try the normal switches for the MSI (which should carry through): /? - run the setup.exe with this switch to see what command line parameters are available to you. /qn - try running the setup.exe with this same quiet switch as the MSI. If the wrapper is passing the parameter through to the MSI, it should give you a silent install. Lastly, if these don't work, if this is a commercial installation that you can point us to we can help troubleshoot further. Obviously if it is something private to your company there is only so much we can do. If the above suggestions don't work and it is not something you can share, we can try walking you through automating the install screens.1 point -
help: copy file to folder
clicklogin1 reacted to MHz for a topic
With the pattern in post #3, this code may do as requested. ; set paths $source = 'C:\daily mail' $destination = 'D:\daily mail' ; check if paths exist For $1 In StringSplit($source & '|' & $destination, '|', 2); no count If Not FileExists($1) Then MsgBox(0x40030, @ScriptName, '"' & $1 & '" does not exist' & @CRLF) Exit 1 EndIf Next ; change to source directory If FileChangeDir($source) Then ; open a handle to find xls files $handle_find = FileFindFirstFile('*.xls') ; check if the handle is valid If $handle_find = -1 Then MsgBox(0x40030, @ScriptName, 'No xls files found') Exit 2 EndIf ; While 1 ; look for the next file $file_found = FileFindNextFile($handle_find) If @error Then ExitLoop ; check the file name with this pattern which returns the group in the name $folder = StringRegExpReplace($file_found, '\A\w{4} (.*) \w{3}\.xls\Z', '$1') ; if replacements occurred and folder is something If @extended And $folder Then ; if destination file exists then restart the loop If FileExists($destination & '\' & $folder & '\' & $file_found) Then ContinueLoop EndIf ; create the destination\folder If DirCreate($destination & '\' & $folder) Then ; copy the file to the destination\folder If Not FileCopy($file_found, $destination & '\' & $folder & '\') Then ConsoleWriteError('Failed to copy "' & $file_found & '"' & @CRLF) EndIf Else ConsoleWriteError('Failed to create folder "' & $folder & '"' & @CRLF) EndIf Else ConsoleWriteError('File "' & $file_found & '" did not match the pattern' & @CRLF) EndIf WEnd ; close the find xls files handle FileClose($handle_find) Else MsgBox(0x40030, @ScriptName, 'Unable to change working directory to "' & $source & '"' & @CRLF) EndIf1 point -
help: copy file to folder
clicklogin1 reacted to 0xdefea7 for a topic
This is untested, but might do what you want without making duplicates: #include <File.au3> $sPath = @HomeDrive & "\daily mai" $aFiles = _FileListToArray($sPath) $sBushObama = "D:\data mail\bush obama" $sLaNy = "D:\data mail\la ny" For $i = 0 To UBound($aFiles) - 1 If StringInStr($aFiles[$i], "Bush Obama") && Not FileExists($sBushObama & "\" & $aFiles[$i]) Then FileCopy($sPath & "\" & $aFiles[i], $sBushObama & "\" & $aFiles[$i]) If StringInStr($aFiles[$i], "la ny") && Not FileExists($sLaNy & "\" & $aFiles[$i]) Then FileCopy($sPath & "\" & $aFiles[i], $sLaNy & "\" & $aFiles[$i]) Next1 point -
help: copy file to folder
clicklogin1 reacted to Melba23 for a topic
clicklogin1, No problem - the accounts have been merged as you will see if you refresh the page. M231 point -
help: copy file to folder
clicklogin1 reacted to Melba23 for a topic
clicklogin and clicklogin1, You appear to have multiple accounts - this is not permitted here. I can merge them into a single account - which one do you wish to keep. M231 point -
help: copy file to folder
clicklogin1 reacted to kylomas for a topic
clicklogin, 1 - Is the target folder always that part of the filename between a space and a period? e.g. c:testmy new dataset.xls target folder = "dataset" 2 - Are all of the files that you receive in a specific folder? 3 - If 2 is 'yes', then do you want to move all files everytime the automation runs? kylomas1 point -
Reluctantly asking for some help Please.
Nilywxywml reacted to Cabler for a topic
Hi Im Ricky I have been trying set something up for a long time now many months and have done a lot of googling and reading the forums/researching gleaming info here and there before coming here and asking for some help I am of the older generation not long before I draw my pension but after a couple of heart attacks and two strokes do stuggle at times with trying to figure out some of the script stuff but I do try to keep the grey matter alive.. Ok down to buisiness.. I need access to my pc remotely when I am away from home so I use wol to start my pc remotely over the internet, the router I use I have to enable telnet mode by accessing a hidden web page on the router and log in then I have telnet access..I then set up a static arp to my pc so as it knows where to send the wol magic packet to wake it up if I dont do this then when the pc is shut down the router clears the arp cache and doesnt know where to send the magic packet..ok so far this is all well and good but if I have a power failure of the router reboots then all is lost and it goes back to default no telnet acces and no static arp route to my pc so no remote access.. Ok I decided to write a script that when the computer is auto powered on early in the am it runs a script that opens an ie windows and navigates to the enable telnet page logs in with user name and password then closes it then it calls a program/script called arse (Automatic Router Scripting Engine is a tool to send command scripts to your router automatically via telnet)written in autoit by cor a very nice utility.. which sets the static arp.. thats it.. The problem I am having is that it works fine half a dozen or so times then for some reason it seems to lose focus of the login window and does nothing unless I click anyware in the login window the it logs in and closes the ie session and then runs arse as it should do. What I was hopeing for was someone to cast an eye over the script and see if theres any faults or maybe a better way to do this so as it is reliable and doesnt loose focus on the login popup.. anyways thanks for your time heres the script regards Ricky #AutoIt3Wrapper_UseX64=N $uNAME = "user" ;Change to your username to your router username $uPASS = "pass" ;Change to your password to your router password $oIE = ObjCreate ( "InternetExplorer.Application" ) $oIE.Visible = 1 $oIE.Left = 600 $oIE.Top = 300 $oIE.Width = @DesktopWidth /4.4 $oIE.Height = @DesktopHeight /3.4 $oIE.Menubar = 0 $oIE.Toolbar = 0 $oIE.Statusbar = 0 $oIE.Resizable = 0 $uRL = "192.168.1.2/setup.cgi?todo=debug" ;Send the command to enable telnet on dgnd3700v2 $oIE.Navigate ($uRL) Sleep (800) WinWaitActive ("Windows Security", "" ,1000000) WinActivate ("Windows Security") ControlSetText("Windows Security", "", "Edit1", ($uNAME)) Sleep (500) ControlSetText("Windows Security", "", "Edit2",($uPASS)) Sleep (500) ControlClick ("Windows Security", "", "Button2") Sleep (500) controlfocus("http://192.168.1.2/setup.cgi?todo=debug - Windows Internet Explorer", "Class:IEFramehttp://192.168.1.2/setup.cgi?todo=debug - Windows Internet Explorer", "Internet Explorer_Server1");Focus on the finished ie window Sleep (100) WinClose("http://192.168.1.2/setup.cgi?todo=debug - Windows Internet Explorer") ;Close the finished ie window Sleep (600) ShellExecute("NetSet.arse") ;Set static arp Exit1 point -
Form Builder beta
hanusherado reacted to Morthawt for a topic
VERY impressive indeed. Something like this should replace Koda... Koda has such a windows 98 basic feel to it. This one you have made has a much richer modern look and functionality. Bloody good job indeed!1 point -
scite helper
mLipok reacted to akurakkauaaa for a topic
simple helper for scite 5 tabs 1. helper 2. search func/macro/string/const/etc... 3. find func / string in pc 4. google translator 5 include helper (include optimizer). update 1.3 added: new tab: Include Helper (Include Optimizer). update 1.2 file "helper.ini" for 3.3.8.0 au3 version. added: new tab: google translator.SciTE Helper 1.3.zip1 point -
For sure , but here's my little example... needed the func for an app. #include <WinAPI.au3> #include <WindowsConstants.au3> #include<GUIConstants.au3> Opt('GuiOnEventMode', 1) $hGui = GUICreate("hWnd, PID and Exe under cursor", 350, 67, 244, 160, BitOR($WS_POPUP, $WS_BORDER, $WS_SIZEBOX), BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST)) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $label = GUICtrlCreateLabel("", 0, 0, 350, 200, 0, $GUI_WS_EX_PARENTDRAG) GUICtrlSetBkColor(-1, 0xEEF1F6) GUICtrlSetColor(-1, 0x000000) GUISetState(@SW_SHOW) While Sleep(50) $hWndCtrl = HWnd(_WindowFromPoint()) $hWndWin = _WinAPI_GetAncestor($hWndCtrl, $GA_ROOTOWNER) $hWndPid = WinGetProcess($hWndWin) $hWndExeLoc = _ProcessGetLocation($hWndPid) $hWndExe = StringRight($hWndExeLoc, StringLen($hWndExeLoc) - StringInStr($hWndExeLoc, "\", 0, -1)) GUICtrlSetData($label, "$hWndCtrl " & @TAB & $hWndCtrl & @CRLF _ & "$hWndWin " & @TAB & $hWndWin & @CRLF _ & "$hWndPid " & @TAB & $hWndPid & @CRLF _ & "$hWndExe " & @TAB & $hWndExe & @CRLF _ & "$hWndExeLoc " & @TAB & $hWndExeLoc) WEnd Func _WindowFromPoint() ; from _GUICtrl_SetOnHover ; http://www.autoitscript.com/forum/index.php?s=&showtopic=55120 ; by G.Sandler a.k.a MrCreatoR (CreatoR's Lab, http://creator-lab.ucoz.ru) Local $Old_Opt_MCM = Opt("MouseCoordMode", 1) Local $aRet = DllCall("User32.dll", "int", "WindowFromPoint", _ "long", MouseGetPos(0), _ "long", MouseGetPos(1)) ;$aRet = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $aRet[0]) Opt("MouseCoordMode", $Old_Opt_MCM) Return $aRet[0] EndFunc ;==>_WindowFromPoint Func _ProcessGetLocation($iPID) Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID) If $aProc[0] = 0 Then Return SetError(1, 0, '') Local $vStruct = DllStructCreate('int[1024]') DllCall('psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc[0], 'ptr', DllStructGetPtr($vStruct), 'int', DllStructGetSize($vStruct), 'int_ptr', 0) Local $aReturn = DllCall('psapi.dll', 'int', 'GetModuleFileNameEx', 'hwnd', $aProc[0], 'int', DllStructGetData($vStruct, 1), 'str', '', 'int', 2048) If StringLen($aReturn[3]) = 0 Then Return SetError(2, 0, '') Return $aReturn[3] EndFunc ;==>_ProcessGetLocation Func _Exit() Exit EndFunc ;==>_Exit1 point
-
Hi, Check the _GUIInputSetOnlyNumbers() UDF from my signature, there is an example of how to catch the input focus.1 point
-
if I am correct...if I use the while ( WinActive("[TITLE: STARTMENU; CLASS: DV2ControlHost]", "") = 0 ) do stuff... wend it will stop my program from running and stick in the loop see, I want the program I have to either...Create... a new file, then run it, or, have my currently already made file continuously check to see if its open, while continueing through the rest of the script. btw, you can use shellexecute("name.au3") to run files that are not .exe1 point