wysocki Posted April 5, 2008 Posted April 5, 2008 I wrote a small script which just reads and writes some text files and runs fine. I want to be able to run it on another computer so I did a BUILD and then tried to run the exe. It crashed with the message "Unable to open the script file". I tried a COMPILE (not sure of the difference) with the same results. I want to be able to copy this exe to run on another computer that doesn't have AutoIt installed. What did I do wrong?
weaponx Posted April 5, 2008 Posted April 5, 2008 You will probably need to post some of your script. IT sounds like some error checking will be needed to ensure the files can be read.
wysocki Posted April 5, 2008 Author Posted April 5, 2008 Here it is. Not much there but it runs fine as an au3. If MsgBox(1+32,"Proceed?","This program will read all the *.URL files in the folder it" & @CR & "is run from and extract the URL= locations from them." & @CR & "They will be listed in the URL.TXT file." & @CR & "Proceed?") = 1 Then $search = FileFindFirstFile("*.url") If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf $wHnd=FileOpen('url.txt',2) While 1 $filename = FileFindNextFile($search) If @error Then ExitLoop $fHnd=FileOpen($filename,0) If $fHnd = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf $text = FileRead($fHnd) $url = StringMid($text,StringInStr($text,"://")+3) $url = StringLeft($url,StringInStr($url ,"/")-1) If StringLeft($url,4) = 'www.' Then $url = StringMid($url, 5) EndIf FileWrite($wHnd, $url & @CRLF) FileClose($fHnd) WEnd FileClose($wHnd) FileClose($search) MsgBox(48,'Done','URL.TXT file has been created.') EndIf
XxCOOLxX Posted April 5, 2008 Posted April 5, 2008 Here it is. Not much there but it runs fine as an au3. If MsgBox(1+32,"Proceed?","This program will read all the *.URL files in the folder it" & @CR & "is run from and extract the URL= locations from them." & @CR & "They will be listed in the URL.TXT file." & @CR & "Proceed?") = 1 Then $search = FileFindFirstFile("*.url") If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf $wHnd=FileOpen('url.txt',2) While 1 $filename = FileFindNextFile($search) If @error Then ExitLoop $fHnd=FileOpen($filename,0) If $fHnd = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf $text = FileRead($fHnd) $url = StringMid($text,StringInStr($text,"://")+3) $url = StringLeft($url,StringInStr($url ,"/")-1) If StringLeft($url,4) = 'www.' Then $url = StringMid($url, 5) EndIf FileWrite($wHnd, $url & @CRLF) FileClose($fHnd) WEnd FileClose($wHnd) FileClose($search) MsgBox(48,'Done','URL.TXT file has been created.') EndIf The same thing is happening wth my scripts all i do is "compile with Optins" maybe work 4 u 2 <- Paid ME $89.65
MHz Posted April 6, 2008 Posted April 6, 2008 If the installations of AutoIt3 and Scite4AutoIt3 are not the latest versions, then try uninstalling them, downloading the latest versions and installing the latest versions.
wysocki Posted April 6, 2008 Author Posted April 6, 2008 If the installations of AutoIt3 and Scite4AutoIt3 are not the latest versions, then try uninstalling them, downloading the latest versions and installing the latest versions.That fixed it, Thanks!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now