That happens because you are using a relative path. Put this snippet before creating a FSO:
var shell = new ActiveXObject("WScript.Shell");
alert(shell.currentDirectory);
Probably your HTA alerts C:\Windows\System32
(depended on the used OS). This is the folder, where you can find test.txt
. Also "Path not found
" error is now explained...
To fix the issue, use absolute paths only, or set the current directory:
shell.currentDirectory = 'C:/Some_Path';