Reputation: 51
What I tried:
function getCurrentPath(){
var fso = new ActiveXObject("Scripting.FileSystemObject");
return fso.GetFolder(".").Path;
}
This code is in a HTML file. Now I want to get the folder path the HTML is in.
But it always return the desktop path.
Upvotes: 1
Views: 2643
Reputation: 8621
You can do this with the following code:
var fso = new ActiveXObject("scripting.FileSystemObject");
return fso.GetAbsolutePathName(".");
Upvotes: 1