What to do when fileappend fails to write i.e. errorlevel=1
the folder is %temp% on my local computer
any help pls??
Fileappend failed to write html on folder %temp% Topic is solved
-
- Posts: 112
- Joined: 06 Jun 2016, 21:32
Re: Fileappend failed to write html on folder %temp%
Use a_lasterror and lookup the error code.
Code: Select all
;https://docs.microsoft.com/en-us/windows/desktop/Debug/system-error-codes
fileappend, some_text ,%temp%
msgbox % a_lasterror
Re: Fileappend failed to write html on folder %temp%
@trust_me I think it should be something like: FileAppend some_text, % A_Temp . "\some_filename.txt".
Re: Fileappend failed to write html on folder %temp%
you are right , but i did this ( %temp% is empty) to create an error to show in the msgbox .
My guess is that OP has a non standard temp folder and defines it in %temp% .
btw thanks for your informative posts Flipeador i learned a lot from them ( and kept some nice code bits that could be handy some time ! )
My guess is that OP has a non standard temp folder and defines it in %temp% .
btw thanks for your informative posts Flipeador i learned a lot from them ( and kept some nice code bits that could be handy some time ! )
Re: Fileappend failed to write html on folder %temp% Topic is solved
EDIT : Unless you use #NoEnv, temp is normally equal to A_Temp. temp is a user environment variable.
thank you for the error code link
https://docs.microsoft.com/en-us/window ... rror-codes
thank you for the error code link
https://docs.microsoft.com/en-us/window ... rror-codes
Code: Select all
;https://docs.microsoft.com/en-us/windows/desktop/Debug/system-error-codes
fileappend, some_text ,%a_temp% ;- error = 5 because filename missing / Access is denied.
e .= "1=" . a_lasterror . "`n"
fileappend, some_text ,%temp%\xy1.txt
e .= "2=" . a_lasterror . "`n" ;- error = 183 Cannot create a file when that file already exists.
f2=%a_temp%\xy2.txt
ifexist,%f2%
filedelete,%f2%
fileappend, some_text ,%f2%
e .= "3=" . a_lasterror . "`n" ;- error = 0
run,%a_temp%
msgbox,%e%
return
Last edited by garry on 01 Aug 2018, 09:41, edited 1 time in total.
Re: Fileappend failed to write html on folder %temp%
@Flipeador , thank you
Unless you use #NoEnv, temp is normally equal to A_Temp. temp is a user environment variable.
Who is online
Users browsing this forum: No registered users and 216 guests