wesb Posted June 9, 2004 Posted June 9, 2004 first of all, love autoit...i have recently run into a problem with running scripts on some machines. I get the error "Unable to open file". i have rewritten the script on one occasion in ver 2.64 and it ran fine. I didnot do that with this one i just wrote. It ran fine on one WinXP machine SP1 patched but did not run on another same image as the first. Any ideas?? I even ran other 3.0 scripts on the failed machine and they ran fine. thanks, Quote $exists = fileexists("c:\windows\options\Office2003\Logs\oabsize.txt")if $exists <>1 then $oabsize = FileOpen("c:\windows\options\Office2003\Logs\oabsize.txt", 1); Check if file opened for reading OKIf $oabsize = -1 Then MsgBox(0, "Error", "Unable to open file.") ExitEndIffilewriteline($oabsize, "")filewriteline($oabsize, "This is a list of actual PST sizes taken before and after a supposed daily OAB download in Office 2003.")filewriteline($oabsize, "Across the top is the file names and the resulting numbers below each file name are the date, time and file sizes.")filewriteline($oabsize, @ComputerName)filewriteline($oabsize, "Date & Time" & @TAB & @TAB & @TAB & "Browse.OAB" & @TAB & "ANRDEX.OAB" & @TAB & "PDNDEX.OAB" & @TAB & "DETAILS.OAB" & @TAB & "RDNDEX.OAB")filewriteline($oabsize, "")fileclose($oabsize)endif$oabsize = FileOpen("c:\windows\options\Office2003\Logs\oabsize.txt", 1); Check if file opened for reading OKIf $oabsize = -1 Then MsgBox(0, "Error", "Unable to open file.") ExitEndIf$folder=(@userprofiledir & "\outlook\");msgbox(0,"this is in", "this is in the " & $folder & " dir");exit$Browse=FileGetSize($folder & "browse.oab")$ANRDEX=FileGetSize($folder & "anrdex.oab")$PDNDEX=FileGetSize($folder & "pdndex.oab")$Details=FileGetSize($folder & "details.oab")$RDNDEX=FileGetSize($folder & "rdndex.oab")fileWriteLine($oabsize, @mon & "/" & @mday & " " & @hour & ":" & @min & ":" & @SEC & @TAB & @TAB & $browse & @TAB & @TAB & $anrdex & @TAB & $pdndex & @TAB & @TAB & $details & @TAB & $rdndex)fileclose($oabsize)
Josbe Posted June 9, 2004 Posted June 9, 2004 First: v2-->v3 Converter.Maybe...the file is opened for another process.(Read-Only) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
Josbe Posted June 9, 2004 Posted June 9, 2004 Also check if it's the same problem --> Related topic AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
Developers Jos Posted June 9, 2004 Developers Posted June 9, 2004 wesb said: first of all, love autoit...i have recently run into a problem with running scripts on some machines. I get the error "Unable to open file". i have rewritten the script on one occasion in ver 2.64 and it ran fine. I didnot do that with this one i just wrote. It ran fine on one WinXP machine SP1 patched but did not run on another same image as the first. Any ideas?? I even ran other 3.0 scripts on the failed machine and they ran fine. thanks,Are you sure the Path exists ? (c:\windows\options\Office2003\Logs\)Which of the fileOpen statements fail ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
jpm Posted June 9, 2004 Posted June 9, 2004 If I undestand well if the file does not exist you try to open it. It should never work. $exists = fileexists("c:\windows\options\Office2003\Logs\oabsize.txt") if $exists <>1 then if the file does not exist "$exists" will be set to 0 and the then clause will be executed Which version of AutoIt3 are you running?
wesb Posted June 9, 2004 Author Posted June 9, 2004 Awesome...can you say "DUHHHH!" boy do i feel stupid. thanks a lot for seeing what i had right infront of me...gotta create the folders first. One of those dayz
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