Page 1 of 1

writefile - quoted filename?

Posted: 01 Aug 2011 13:30
by highend
Not sure if this is a bug or not...

Code: Select all

$HiDriveTempBatchFile = quote("D:\temp\a und b.txt");
msg $HiDriveTempBatchFile;
writefile("D:\temp\a und b.txt", "@Echo off".<crlf>, o, ta);
Leads to the output:

Code: Select all

"D:\temp\a und b.txt"
and the writefile succeeds.

But if I replace the path in the writefile line with the $HiDriveTempBatchFile variable, it isn't working anymore...

Code: Select all

$HiDriveTempBatchFile = quote("D:\temp\a und b.txt");
msg $HiDriveTempBatchFile;
writefile($HiDriveTempBatchFile, "@Echo off".<crlf>, o, ta);
Unbenannt.png
Any hints?

Re: writefile - quoted filename?

Posted: 24 Aug 2011 12:57
by admin
Why do you quote? This adds quotes to the filename which is illegal of course.

Code: Select all

$HiDriveTempBatchFile = quote("D:\temp\a und b.txt");
Simply do this instead:

Code: Select all

$HiDriveTempBatchFile = "D:\temp\a und b.txt";