Frisco1
asked on
Using CreateTextFile - How to set the path to where the file is saved on local machine.
Using the following script I can get the file saved to the local desktop just fine.
How can I specify a different location to save the file in.
i.e. C:/build/mybuild/NewFile.t xt
<script language="javascript">
function WriteToFile()
{
var fso = new ActiveXObject("Scripting.F ileSystemO bject");
var s = fso.CreateTextFile("C:\\Ne wFile.txt" , true);
var text=document.getElementBy Id("TextAr ea1").inne rText;
s.WriteLine(text);
s.WriteLine('************* ********** ');
s.Close();
}
</script>
Your help will be appreciated.
Thank you,
frisco1
How can I specify a different location to save the file in.
i.e. C:/build/mybuild/NewFile.t
<script language="javascript">
function WriteToFile()
{
var fso = new ActiveXObject("Scripting.F
var s = fso.CreateTextFile("C:\\Ne
var text=document.getElementBy
s.WriteLine(text);
s.WriteLine('*************
s.Close();
}
</script>
Your help will be appreciated.
Thank you,
frisco1
var s = fso.CreateTextFile("C:\\bu ild\\mybui ld\\NewFil e.txt", true);
ASKER
hielo,
Thank you for your quick answer.
It still put the file on the desktop and named it;
buildmybuildNewFile.txt
I should show you the exact line I used.
OpenWindow.document.write( "var s = fso.CreateTextFile(\"C:\\a tbuild\\at b\\NewFile .txt\", true);");
Please advise
Thank you,
frisco1
Thank you for your quick answer.
It still put the file on the desktop and named it;
buildmybuildNewFile.txt
I should show you the exact line I used.
OpenWindow.document.write(
Please advise
Thank you,
frisco1
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hielo,
That got it - Thanks.
frisco1
That got it - Thanks.
frisco1
ASKER
I appreciate your help. Thank you