Fileappend failed to write html on folder %temp% Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
MonuKashyap
Posts: 112
Joined: 06 Jun 2016, 21:32

Fileappend failed to write html on folder %temp%

01 Aug 2018, 05:49

What to do when fileappend fails to write i.e. errorlevel=1
the folder is %temp% on my local computer
any help pls??
trust_me
Posts: 98
Joined: 29 Jul 2017, 10:46

Re: Fileappend failed to write html on folder %temp%

01 Aug 2018, 07:04

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
User avatar
Flipeador
Posts: 1204
Joined: 15 Nov 2014, 21:31
Location: Argentina
Contact:

Re: Fileappend failed to write html on folder %temp%

01 Aug 2018, 07:11

@trust_me I think it should be something like: FileAppend some_text, % A_Temp . "\some_filename.txt".
trust_me
Posts: 98
Joined: 29 Jul 2017, 10:46

Re: Fileappend failed to write html on folder %temp%

01 Aug 2018, 08:44

:D 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 ! )
garry
Posts: 3763
Joined: 22 Dec 2013, 12:50

Re: Fileappend failed to write html on folder %temp%  Topic is solved

01 Aug 2018, 08:55

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

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.
User avatar
Flipeador
Posts: 1204
Joined: 15 Nov 2014, 21:31
Location: Argentina
Contact:

Re: Fileappend failed to write html on folder %temp%

01 Aug 2018, 09:27

@trust_me Unless you use #NoEnv, temp is normally equal to A_Temp. temp is a user environment variable.
;) :wave:
garry
Posts: 3763
Joined: 22 Dec 2013, 12:50

Re: Fileappend failed to write html on folder %temp%

01 Aug 2018, 09:40

@Flipeador , thank you
Unless you use #NoEnv, temp is normally equal to A_Temp. temp is a user environment variable.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 216 guests