Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all 12506 articles
Browse latest View live

AD UDF - Performance improvements

$
0
0

When working on the new function _AD_GetObjectOU (returns the OU of a user, group, computer etc.) I noticed the big performance advantage you get when using ADsPath.

(example: processing 120 users to retrieve the OU takes 207ms compared to 1041ms - so it is about 5 times faster).

 

At the moment functions either accept SamAccountName or FQDN as parameters to identify an AD object.

 

Where would you benefit?

It takes a lot fo time when you use _AD_GetObjectsInOU to retrieve objects fitting the search pattern and then need to loop through the resulting array calling _AD_GetobjectProperties for each object to retrieve additional properties.

By using ADsPath this should run much faster.

 

But it needs

  • me to modify a lot of functions in the AD UDF to accept ADsPath as a parameter
  • you to change your script

What do you think? Is it worth the effort.


Using Chrome instead of IE

$
0
0

I'm wondering if there is a way to use the IE functions but have them hit the chrome browser instead? I'm trying to avoid rewriting all my scripts and direct them to chrome and use the same IE functions. Is that possible?

ControlClick help needed :)

$
0
0

Hi,

I'd like my script to click 3 times at a defined coords in Photoshop but I just can't figure out how the syntax should look like.

 

This is how I wrote it but it doesn't work :/

AutoIt         
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Misc.au3> $Coordss = AskUser() MsgBox(0, "", $Coordss[0] & "       " & $Coordss[1]) Func AskUser()     MsgBox(262144, "User Input", "Please click the screen on a certain spot" & @CRLF & "Press OK, and then move your mouse there and click")     Do         Sleep(50)     Until _IsPressed(01)     $Coordss = MouseGetPos()     ;MsgBox(0, "Thank You", "Your coords have been stored for later use")     Return $Coordss EndFunc  ;==>AskUser $Input = InputBox("InputBox", "Coords", $Coordss[0] &"," & $Coordss[1]) $aCoords = StringSplit($Input, ",", 2) Sleep(3000) ControlClick("[CLASS:Photoshop]","","","left",3,$aCoords[0],$aCoords[1])

Howot get data from Array

$
0
0

Hello,

First time in here and already stumbling over the good old array functions again (did have same issues in VBA).

 

Here is what I try to achieve:

I have a userform which I like to populate with data from a CSV file that uses ; as separation marks.

I found the following parser for the array:

http://www.autoitscript.com/forum/topic/143994-csv-parsing/

 

This clearly shows my array coming from the CSV file.

However the problem is how do I get, for example, the data from row 3 column 5 shown as text on a label?

 

For some reason I cant figure it out.

 

I would say following would work but it doesn't:

#include <array.au3> #include <CSV.au3> $rc = _ParseCSV("treintijden.csv", ";" ) For $i = 0 To UBound($rc)     _ArrayDisplay($rc)     ; You can now use the array as necessary Next    msgbox $rc[3][5]

Thanks in advance.

 

Regards,

Demeter

_FilePrint of an "in use" Word document . How to file unlock?

$
0
0

Sometimes when _FilePrint is used to print a Word document which has been locked for some reason (eg. it has just been copied from somewhere) a prompt appears asking the User if a read-only copy may be opened [for the purpose of printing it].

 

I was wondering if there was some way of using _FilePrint to always take a read-only copy to use for printing (so that the pop-up window isn't displayed or has to have additional coding to deal with)?

 

Better still, is there any function (eg. UDF) that can be used to [attempt to] force a file to be unlocked so that Windows doesn't consider it to be "in use" by some process please?

writing a Webpage to a Txt file

$
0
0

Hi,

i am trying to read a body of an internal webpage and write its body to a txt file after performaing a search. so far i have been able to figure out how to do that but the probleum is when ever the body is written in the txt file it is from the page prrior to the search. this is the code. 

 

#include <IE.au3>
 
Local $oIE = _IECreate("internal address")
_IELoadWait ($oIE)
Send("{T}{E}{S}{T}{SPACE}{A}{S}{S}{I}{G}{H}{N}{ENTER}")
_IELoadWait ($oIE)
$sText = _IEBodyReadText($oIE)
$file = FileOpen("test.txt", 1)
FileWrite($file, $sText)
 
one more detail when the search is performed the URL doesnot change. 

3 button question vs 1 button with popup question

$
0
0

Ok not particularly a solve needed more advice i guess

 

Im building a gui with lots of buttons on it (prob 100)

Now each of them has a choice scenario (Yes/No/NA) mostly, i've managed to automate quite a few of them but some are manual checks a tech has to perform.

And here is the problem

I don't know which is the best way to do it from these 2 examples

Should i create three button one for each choice like this

        Case $TimeButton             Local $SetTime = _SyncTime()             GUICtrlSetImage($TimeIcon, $tick)             RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\Setup\Simple', 'Time', 'REG_SZ', _Date_Time_SystemTimeToDateTimeStr($CuDate))         Case $TimeButton2             GUICtrlSetImage($TimeIcon, $cross)             RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\Setup\Simple', 'Time', 'REG_SZ', 'NotCompleted')             ShellExecute('timedate.cpl')         Case $TimeButton2             GUICtrlSetImage($TimeIcon, $cross)             RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\Setup\Simple', 'Time', 'REG_SZ', 'NotAvailable')

This obviously increases my button count in a major way

 

Or do i create a single button with a Yes/No/Cancel checkbox behind it like this

            Local $MicCheck = MsgBox($MB_YESNOCANCEL + $MB_ICONWARNING + $MB_DEFBUTTON2, 'Microphone Test', 'Does The Microphone Work')             If $MicCheck = $IDCANCEL Then                 RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\Setup\Simple', 'Microphone', 'REG_SZ', 'NotAvailable')                 GUICtrlSetImage($MicIcon, $maybe)             ElseIf $MicCheck = $IDYES Then                 GUICtrlSetImage($MicIcon, $tick)                 RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\Setup\Simple', 'Microphone', 'REG_SZ', _Date_Time_SystemTimeToDateTimeStr($CuDate))             ElseIf $MicCheck = $IDNO Then                 GUICtrlSetImage($MicIcon, $cross)                 RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\Setup\Simple', 'Microphone', 'REG_SZ', 'NotCompleted')             EndIf

Obviously these are chopped out as examples

 

So which is the most sensible way to go, my boss likes a button for each choice but im not sure due to the amount of creation needed

 

Any thoughts?

Finding Line number of string in txt file

$
0
0

Hi guys, 

 

I have been trying to sort out this issue for a while.  I've tried a bunch of different examples but none have worked.  I have a rather large script at the moment so I will attempt to post the part I'm having issue with.  I have an xml file I need to read from and get the line number of a certain string so I can use the stringmid function to get the account number on that line.  So I need to find the line number of "<RogCustomerAcctNum>".  Once I have that I can use Stringmid to get the 9 digit account number on that line.  Any help would be greatly appreciated.  There will be other line numbers I will need to get as well and hopefully with a little help on this one line will help me get the line number to the other numbers I need.   Also, the "<RogCustomerAcctNum>" isn't always on the same line on that file.  I need to set $accountline to the line number.

 

 

Thanks in advance.

 

Local $sFilePath3 = $SUITEFOLDER & $FOLDERCOUNT & "\RecordData.xml"
 
Local $hFileOpen1 = FileOpen($sFilePath3, $FO_READ)
$sFileRead1 = FileReadLine($hFileOpen1, 2)
$WORKORDER = StringMid($sFileRead1, 16, 13)
$sFileRead2 = FileReadLine($hFileOpen1, 39)
$AREA = StringMid($sFileRead2, 24, 3)
$accountline = ""
$sFileRead3 = FileReadLine($hFileOpen1, $accountline)
$ACCOUNT = StringMid($sFileRead3, 29, 9)
 
 

_IECreate vs ShellExecute

$
0
0

I am trying to figure out a faster way to call a website and login without having to rely on _IEcreate for calling the website, the reason being is _IECreate calling said website which is a citrix environment login can take 15+ seconds to load. Shellexecute takes 2-3 seconds to load(still using IE as the default browser). I assume this is due to the way the functions are utilized and the field is auto populated by the login information I have listed, vs when I shellexecute ill throw in a sleep the send then sleep and send.

 

so IECreate round time is 20 seconds to login

Shellexecute is 5 seconds to login

 

Does anyone know a way to improve the speed of IEcreate? I prefer it as filling the fields automatically is ideal over hoping a user doesnt click in the time it loads into something else messing up the next key stroke. The Joys of login scripts to reduce admin time of having to log into each system manually :(

GUI Always on top question

$
0
0
AutoIt         
#Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form 1", 377, 280, 192, 114) GUICtrlSetState($Form1,$GUI_ONTOP) $Input1 = GUICtrlCreateInput("0", 24, 40, 49, 21) $Input2 = GUICtrlCreateInput("0", 24, 72, 49, 21) $Input3 = GUICtrlCreateInput("0", 24, 104, 49, 21) $Input4 = GUICtrlCreateInput("0", 24, 136, 49, 21) $Input5 = GUICtrlCreateInput("0", 24, 168, 49, 21) $Input6 = GUICtrlCreateInput("0", 240, 40, 49, 21) $Input7 = GUICtrlCreateInput("0", 240, 72, 49, 21) $Input8 = GUICtrlCreateInput("0", 240, 104, 49, 21) $Input9 = GUICtrlCreateInput("0", 240, 136, 49, 21) $Input10 = GUICtrlCreateInput("0", 240, 168, 49, 21) $Label1 = GUICtrlCreateLabel("Option 1", 88, 40, 61, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Option 2", 88, 72, 43, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Label3 = GUICtrlCreateLabel("Option 3", 88, 104, 74, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Label4 = GUICtrlCreateLabel("Option 4", 88, 136, 42, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Label5 = GUICtrlCreateLabel("Option 5", 88, 168, 56, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Label6 = GUICtrlCreateLabel("Option 6", 304, 40, 54, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Label7 = GUICtrlCreateLabel("Option 7", 304, 72, 57, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Label8 = GUICtrlCreateLabel("Option 8", 304, 104, 53, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Label9 = GUICtrlCreateLabel("Option 9", 304, 136, 41, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Label10 = GUICtrlCreateLabel("Option 10", 304, 168, 22, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Label11 = GUICtrlCreateLabel("Pause Script", 144, 8, 98, 17) $Pause = GUICtrlCreateButton("Pause", 24, 216, 97, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ###

Im trying to get this window to stay on top. GUICTRLSETSTATE doesn't seem to work or Im doing it wrong. Also at one point Melba23 replied to one of my posts and made code like the example above significantly shorter somehow. I made the above with Koda. How can I shorten it?

Searching an Excel file

$
0
0

Hello all, I was really hoping I would figure this out on my own but so far no good.

Basicaly, what I'm trying to achieve: 

 

I need to be able to search for a username in autoit and it return the computer name for that user.

I have a list of usernames and computer names in two different columns in an Excel (.xlsx) file. 

 

I'm really struggling to grasp how the different Excel UDF stuff works. 

When I run the script shown below, I'm only getting a result of "Sheet1||$A$1993|username|username|"

I need it to return something like "username|computer-name" from column A and column B.
 

From using example scripts, this is what I have so far: 

AutoIt         
#include <Array.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> ; Create application object and open an example workbook Local $oAppl = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookOpen($oAppl, @ScriptDir & "\Extras\_Excel1.xls") If @error Then     MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example", "Error opening workbook '" & @ScriptDir & "\Extras\_Excel1.xls'." & @CRLF & "@error = " & @error & ", @extended = " & @extended)     _Excel_Close($oAppl)     Exit EndIf ; ***************************************************************************** ; Read the formulas of a cell range (all used cells in column A and B) ; ***************************************************************************** Local $aResult = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.ActiveSheet.Usedrange.Columns("A:B"), 2) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example 3", "Error reading from workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ;MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example 3", "Data successfully read." & @CRLF & "Please click 'OK' to display all formulas in column A.") _ArrayDisplay($aResult, "Excel UDF: _Excel_RangeRead Example 3 - Formulas in column A and B") ; ***************************************************************************** ; Find all occurrences of value "username" (partial match) ; ***************************************************************************** Local $aResult2 = _Excel_RangeFind($oWorkBook, "username") If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeFind Example 1", "Error searching the range." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ;MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeFind Example 1", "Find all occurrences of value 'username' (partial match)." & @CRLF & "Data successfully searched.") _ArrayDisplay($aResult2, "Excel UDF: _Excel_RangeFind Example 1")

I'm open to any recommendations. 

I feel like there is a simple solution to this, I just can't figure it out. 

 

I can use a different way to store the username/computer name information if there is a better way. 

I have tried searching for a solution on the forums and on google and haven't found what i'm looking for. 

(I've attached what my excel spreadsheet looks like format wise)

 

 

Attached Thumbnails

  • excelexample.jpg

Program Files(x86)\AutoIt3\Include Directory Read Only

$
0
0

Hi,

This question is about adding and changing files in the Include Directory. Not a Programming Question.

 

Windows 8.1 Laptop.

 

My Include Directory, actually the entire AutoIt3 folder and everything below is read only. Maybe this is because it is in the Program Files directory, I'm not sure.

 

I have tried to change AutoIt3 and everything below to turn off Read Only. It acts like it works but does not.

This causes me to save my include files to my Script Directory, start File Munger and copy the file to the Include Directory, clicking OK to all the Administrator Permission requests along the way.

 

If I cannot make this directory writable, can I reinstall AutoIt to some other location that may not be Read Only?

Can I include a path in my #include <filename.au3> so it reads #include <mydir\autoit3\include\filename.au3> ?

 

Does anyone else have this problem with Windows 8.1 and AutoIt?

 

Thanks in advance for any advice!

JibsMan

Installing an older version of AutoIT and SciTE breaks my code

$
0
0
Recently, I updated AutoIT to v3.3.12.0 and found that due to some of the SCRIPT BREAKER changes that broke too many of my scripts, I had to uninstall AutoIT and SciTE.  When I reinstalled AutoIT (3.3.10.2) and SciTE4AutoIT (14.801.2025.0), I somehow lost the hooks to run my private Lua scripts from the right click context menu.
 
I've been using my Lua scripts for a while before this so I know there's not a script error.
 
Here's how I added my Lua scripts:
  I copied these files from a local directory C:\Users\Andy
   au3.properties
   PersonalTools.lua
   SciTEUser.properties
 
  The au3.properties file looks like this:
    # Add a _DebugOut statement that displays the hilighted     # data or the word under the cursor like this:     #   _DebugOut("+++: hilighted-text = " & hilighted-text)     command.name.44.$(au3)=     command.subsystem.44.$(au3)=3     command.44.$(au3)=InvokeTool AutoItTools.addDebugOut     command.save.before.44.$(au3)=2
  The PersonalTools.lua file looks like this:
AutoIt         
------------------------------------------------------------------------------- -- required line ... do not remove PersonalTools = EventClass:new(Common) -- -- Trap the OnStartup event --    Create the user shortcut menu -- -- -- Trap the OnOpen event --    Call the createUserContextMenu() function to create a user --    context menu tailored to the file type (lexor) of the file --    being opened. function PersonalTools:OnOpen()     createUserContextMenu(self) end -- -- Create a user context menu tailored to the file type (lexer) -- of the file being opened or switched to. function createUserContextMenu(self)     -- print(self:GetLexer())     if self:IsLexer(SCLEX_AU3) then             --print("AU3 lexer")             props['user.context.menu'] = "|"             .. "|add _DebugOut          | 1144"     end end function PersonalTools:GetLexer(lexer)     return editor.Lexer end -- IsLexer() -------------------------------------------------------------------------------- -- AutoItTools:addDebugOut() -- -- Add a _DebugOut statement that displays the hilighted data or -- the word under the cursor like this: --   _DebugOut("+++: hilighted-text = " & hilighted-text) -------------------------------------------------------------------------------- -- function AutoItTools:addDebugOut()     local word = editor:GetSelText()     if word == ""  or word == nil then         word = self:GetWord()     end             if word ~= nil and word ~= "" then         editor:LineEnd()         editor:NewLine() --                      _Debugout( "+++: word = " & word)         editor:AddText('_Debugout( "+++: ' .. word .. ' = " & ' .. word .. ')')     else         print("The cursor not is not on any hilighted text.")     end end

I see my command when I right click on a word, but then nothing happens when I choose my command from the menu.

        
 

Mouse click problem

$
0
0

Hi there!

 

I am a noob to AutoIt and just starting to familiarize myself to scripting with it. Before this I have been using GUI Macro to automate my task. 

 

So, recently I have been trying to move the mouse pointers and made clicks on the desktop. I activated a program window specially designed to do inventory correction. There was a blank to be filled in with certain information. I scripted something out of AutoIt, and made it to move the mouse pointer and made a right mouse click on the blank field. It should display some context menu. But nothing happened, although it managed to move the mouse pointer where I wanted it to. Automating my task this way has been very helpful to me. I have over 4000+ entries to correct and enter and doing this manually would kill my fingers.

 

Honestly, I have tried  many other macro recorders to do the task but none seems to work. They do work outside the mentioned windows however, but not in it.

 

I read somewhere that, some task automation software cannot work in some circumstances eg gaming as it doesn't interact via the mouse and keyboard drivers directly.Could it be the same in this case  that the inventory program is designed in such a way?

 

Is there a way to go about this?

 

Please, I need help.

 

Thank you in advance.

 

 

Save/Restore Window Function does not restore location for minimized windows

$
0
0

Hey Guys,

 

I was trying to figure out the best way to restore minimized windows with the following script. I was able to get the windows to restore the the original location but when they are minimized they do no restore. Any help would be greatly appreciated!

AutoIt         
#include <WindowsConstants.au3> #include <GuiConstantsEx.au3> $parentgui=GUICreate("Test", 600, 400) $windowsave = GUICtrlCreateButton ("Window Save",280,20,80,20) $windowrestore = GUICtrlCreateButton ("Window Restore",280,40,90,20) $winlist = WinList() GUISetState(@SW_SHOW) ;WINDOWS Save While 1     $iMsg = GUIGetMsg()     Switch $iMsg       GUISetState(@SW_SHOW) Case $GUI_EVENT_CLOSE Exit Case $windowsave StoreWins() msgbox (0,"Your Windws Have Been Saved, Ok to Remove from Dock", "Your Windows Have Been Saved, OK to Remove from Dock") Case $windowrestore WinSetState($winlist,"",@SW_RESTORE) RestoreWins() EndSwitch Wend Func StoreWins($file = "windows.ini")     Local $var = WinList()     If FileExists($file) Then FileDelete($file)     For $i = 1 to $var[0][0]       If IsVisible($var[$i][1]) Then         Local $pos = WinGetPos($var[$i][1])         IniWrite($file, Binary($var[$i][0]), "x", $pos[0])         IniWrite($file, Binary($var[$i][0]), "y", $pos[1])         IniWrite($file, Binary($var[$i][0]), "w", $pos[2])         IniWrite($file, Binary($var[$i][0]), "h", $pos[3])       EndIf     Next EndFunc Func RestoreWins($file = "windows.ini")     Local $var = WinList()     For $i = 1 to $var[0][0]       If IsVisible($var[$i][1]) Then         If IniRead($file, $var[$i][0], "x", False) Then             Local $pos = WinGetPos($var[$i][1])             WinMove($var[$i][0], "", IniRead($file, Binary($var[$i][0]), "x", $pos[0]), IniRead($file, Binary($var[$i][0]), "y", $pos[1]), IniRead($file, Binary($var[$i][0]), "w", $pos[2]), IniRead($file, Binary($var[$i][0]), "h", $pos[3]))         EndIf      EndIf     Next EndFunc Func IsVisible($handle)     Return BitAnd(WinGetState($handle), 2) EndFunc

Taskbar Icon changeable (not TrayIcon)

$
0
0

Hello,

 

I can set the TrayIcon with the command "TraySetIcon".

But how can I change the Icon shown on the tasbar (e.g. when a GUI-Screen pops up)?

Thank U for your help.

 

Bye.

Folder size exclude an ext

$
0
0

Proprably impossible but i'll try to ask.

There is an API, WMI or any other things that give me a folder size but with a filter, so excluding an extension of a file? Like take this folder ( and his subfolder ) give me the size without any .word file.

I know i can search all the file, exclude the .word, loop all the file with FileGetSize and finally sum the total size but if exist a faster way please tell me.

Thank you

Parse CSV crash

$
0
0

I'm having some trouble debugging this issue. I use the following ParseCSV script:

AutoIt         
Func _ParseCSV($sFile, $sDelimiters = ',;', $sQuote = '"', $iFormat = 0, $iAddIndex = 0, $AddHeader = 0)     Local Static $aEncoding[6] = [0, 0, 32, 64, 128, 256]     If $iFormat < -1 Or $iFormat > 6 Then         Return SetError(3, 0, 0)     ElseIf $iFormat > -1 Then         Local $hFile = FileOpen($sFile, $aEncoding[$iFormat]), $sLine, $aTemp, $aCSV[1], $iReserved, $iCount         If @error Then Return SetError(1, @error, 0)         $sFile = FileRead($hFile)         FileClose($hFile)     EndIf     If $sDelimiters = "" Or IsKeyword($sDelimiters) Then $sDelimiters = ',;'     If $sQuote = "" Or IsKeyword($sQuote) Then $sQuote = '"'     $sQuote = StringLeft($sQuote, 1)     $iAddIndex = Number($iAddIndex=True)     $AddHeader = Number($AddHeader=True)     Local $srDelimiters = StringRegExpReplace($sDelimiters, '[\\\^\-\[\]]', '\\\0')     Local $srQuote = StringRegExpReplace($sQuote, '[\\\^\-\[\]]', '\\\0')     Local $sPattern = StringReplace(StringReplace('(?m)(?:^|[,])\h*(["](?:[^"]|["]{2})*["]|[^,\r\n]*)(\v+)?', ',', $srDelimiters, 0, 1), '"', $srQuote, 0, 1)     Local $aREgex = StringRegExp($sFile, $sPattern, 3)     If @error Then Return SetError(2, @error, 0)     $sFile = '' ; save memory     Local $iBound = UBound($aREgex), $iIndex = $AddHeader, $iSubBound = 1+$iAddIndex, $iSub = $iAddIndex, $sLast='' ;changed     If $iBound Then $sLast = $aREgex[$iBound-1]     Local $aResult[$iBound + $iAddIndex][$iSubBound] ;changed     For $i = 0 To $iBound - 1         If $iSub = $iSubBound Then             $iSubBound += 1             ReDim $aResult[$iBound][$iSubBound]         EndIf         Select             Case StringLeft(StringStripWS($aREgex[$i], 1), 1) = $sQuote                 $aREgex[$i] = StringStripWS($aREgex[$i], 3)                 $aResult[$iIndex][$iSub] = $aREgex[$i] ;~                 $aResult[$iIndex][$iSub] = StringReplace(StringMid($aREgex[$i], 2, StringLen($aREgex[$i])-2), $sQuote&$sQuote, $sQuote, 0, 1)             Case StringRegExp($aREgex[$i], '^\v+$') ; StringLen($aREgex[$i]) < 3 And StringInStr(@CRLF, $aREgex[$i]) ;new line found                 StringReplace($aREgex[$i], @LF, "", 0, 1)                 $iIndex += @extended                 $iSub = $iAddIndex ;changed                 ContinueLoop             Case Else                 $aResult[$iIndex][$iSub] = $aREgex[$i]         EndSelect         $aREgex[$i] = 0 ; save memory         $iSub += 1         If $iAddIndex Then $aResult[$iIndex][0] = $iIndex ;added     Next     If Not StringRegExp($sLast, '^\v+$') Then $iIndex+=1     ReDim $aResult[$iIndex][$iSubBound - 1]     If $iAddIndex Then $aResult[0][0] = "Index" ;added     If $AddHeader Then         For $i = 1 To $iSubBound - 2             $aResult[0][$i] = "Col" & $i         Next     EndIf     Return $aResult EndFunc   ;==>_ParseCSV

but on some of the files I am importing to an array using this method, the script crashes (No error in SCITE but a windows crash dialog) giving the following:

 

Problem signature:

  Problem Event Name: APPCRASH
  Application Name: autoit3.exe
  Application Version: 3.3.13.19
  Application Timestamp: 53fa0936
  Fault Module Name: autoit3.exe
  Fault Module Version: 3.3.13.19
  Fault Module Timestamp: 53fa0936
  Exception Code: c00000fd
  Exception Offset: 000102f9
  OS Version: 6.1.7601.2.1.0.256.48
  Locale ID: 1033
  Additional Information 1: 4181
  Additional Information 2: 41810812715e7a6496820cf28371c79c
  Additional Information 3: 9615
  Additional Information 4: 9615c990bcbe602452124ea23ad11713
 
Read our privacy statement online:
 
If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt
 

I have tried deleting some of the rows in the CSV file and sometimes it works, other times it doesn't. I think the issue might be with the amount of memory I have because if I keep it to 100 records (out of 1600) it never crashes. One of the records is a very long text field that may also be causing the issue. Any suggestions on how to figure out what the issue is here so I can actually handle the exception?

pass variables from a bat to an autoit exe or script

$
0
0

hello  everyone and thank you in advance for the support.i m using a software called watchdirectory

 

i setted it to watch a folder for any newly created file

 

when a newly created file exist it should execute a bat

 

in this bat

 

 

notepad c:\monitoreddir\%wdfile_b%.%wdfile_e% (notice tha this variable is a special envirointment variable setted when the monitoring task by watchdirectory is running)

 

set filename=%wdfile_b%

 

autoitexescript.exe

 

 

here te autoit script goes and modify some values of the txt window

 

to do so i need to activate the notepad window but if the file name changes every time i can so i was thinking is it possible to  pass to autoit %filename% variable that was inside the bat and then compile the script as an exe ? if yes how ?

 

regards

How to access database on remote computer?

$
0
0

I have two equal databases. The first one is install on the local machine and the second one on the virtual machine. I have no problem while connecting the database on local machine

  1. _AccessOpen(@ProgramFilesDir & "\MyFolder\DB\MyDB.mdb")

To access database on the virtual machine I share database folder and do the same

  1. _AccessOpen("\\111.222.3.44\MyFolder\DB\MyDB.mdb")

But I receive an error "The requested action with this object has failed.:

$o_doc = $o_object.OpenDatabase($s_FilePath, $Options, $ReadOnly, $Connect)
$o_doc = $o_object.OpenDatabase($s_FilePath, $Options, $ReadOnly, $Connect)^ ERROR"

 

From another hand I can access text file from DB folder without any problem:

  1. ShellExecute ("\\111.222.3.444\DB\TestFile.txt")
Viewing all 12506 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>