/    Sign up×
Community /Pin to ProfileBookmark

fso issue…

This is starting to bug me…the fso.GetFile is working fine, but WShell is not….any ideas?

var fso = new ActiveXObject(“Scripting.FileSystemObject”);
var WShell= new ActiveXObject(“WScript.Shell”);
var p=fso.GetFile(slasher(unescape(document.location.pathname))).ParentFolder
alert(p)
p = fso.GetFile(p+”Free-Former.hta”)

function slasher(strInput){
var strResult;
var objRegex = //g;
strResult = strInput.replace(objRegex, ““+”“);
strResult = Right(strResult,Len(strResult)-1)
return(strResult);
}

function FreeOpen(){
[COLOR=Red][B]WShell.run(p)[/B][/COLOR] //<—System Cannot find the file specified…
}

to post a comment
JavaScript

11 Comments(s)

Copy linkTweet thisAlerts:
@so_is_thisDec 03.2006 — If you put another [B]alert[/B] after that last GetFile, what is returned?
Copy linkTweet thisAlerts:
@TNOauthorDec 03.2006 — The entire path without a hitch:

[B]C:Documents and Settings****DesktopClerkstermainFree-Former.hta[/B]
Copy linkTweet thisAlerts:
@so_is_thisDec 03.2006 — What result do you get if you do this?

WShell.run("cmd.exe " + p);
Copy linkTweet thisAlerts:
@TNOauthorDec 03.2006 — Command Prompt shows:

[B]C:Documents and Settings****DesktopClerkster>[/B]
Copy linkTweet thisAlerts:
@so_is_thisDec 03.2006 — Is this statement being executed inside of a function?

var p=fso.GetFile(slasher(unescape(document.location.pathname))).ParentFolder
Copy linkTweet thisAlerts:
@TNOauthorDec 03.2006 — Its global
Copy linkTweet thisAlerts:
@so_is_thisDec 04.2006 — Yeah? ...and if you do this -- does it display the correct information?

function FreeOpen(){

alert(p);

WShell.run(p) //<---System Cannot find the file specified...

}
Copy linkTweet thisAlerts:
@TNOauthorDec 04.2006 — it gives the full path again....

[B]C:Documents and Settings****DesktopClerkstermainFree-Former.hta[/B]

I've never had an issue like this before, its strange as hell. (Using IE6 & WSH 5.6)
Copy linkTweet thisAlerts:
@TNOauthorDec 04.2006 — I also tried moving [B]var WShell[/B] inside the function but to no avail. Along with renaming the variable just in case......strange
Copy linkTweet thisAlerts:
@TNOauthorDec 04.2006 — well, if I can't open an hta program from my main hta, is there a way to get popup window that still has the same file access rights as its parents? What about window.showModalDialog()?
Copy linkTweet thisAlerts:
@TNOauthorDec 04.2006 — Heres some sample files that recreate the problem:

http://thenewobjective.com/temp/Clerkster.zip

Is this giving anyone else the same problem or is it just me?
×

Success!

Help @TNO spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...