2

I would like to determine the path of "my documents" folder with Javascript. I need it to specify the folder where I could store the logs of my application.

Thanks

2 Answers 2

2

Use the SpecialFolders-method of the shell:

shell = new ActiveXObject("WScript.Shell");
pathToMyDocuments = shell.SpecialFolders('MyDocuments');

http://msdn.microsoft.com/en-us/library/0ea7b5xe%28v=vs.85%29.aspx

Sign up to request clarification or add additional context in comments.

Comments

1

You can't access client file system with Javascript for obvious security reasons.

7 Comments

I'm using IE and ActiveX for my application, you can allow a trusted activeX to access your file system...Or so, I believe
I really wouldn't recommend it.
Ok, so how could I set a folder for the logs of my application on client side without accessing such informations ?
You want to do logging on the client side ??
Why is it bad or incorrect for an application to access the file-system? The topic is about an application, not a webpage. So if the user trusts the application, why not doing this(everybody trusts every day hundreds of applications)
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.