Hi,

I have a scenario where, I have to read path of exe and execute it, from previous folder.
for example:
folder structure is, c:\a\b\c
test.exe is situated in folder "a", my vbscript is in folder c, then how can i read path of test.exe from folcer "c"

I hope you get what I mean to say...
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
What's wrong with using a relative path? That is, if you're using the Shell object's Run method to run the executable, you'd have something likeobjShell.Run "..\..\NAMEOFEXE.EXE"
Answered 02/03/2010 by: VBScab
Red Belt

Please log in to comment
0
I did not get you...

If I am writing in this way, then do not you think, path will become hardcoded? Can u give me any sample code to understand it clearly?I understood some part from following link...but not able to achieve the scenario which i want,

http://help.lockergnome.com/general/open-relative-path-VBScript--ftopict54500.html
Answered 02/04/2010 by: Yaduveer
Orange Senior Belt

Please log in to comment
0
Got it..

for going to 1 previous folder, we have to put "..\"
Answered 02/04/2010 by: Yaduveer
Orange Senior Belt

Please log in to comment
0
If you know that the EXE will always be one level up from the script, then the syntax we've discussed is good enough. If you want to completely abstract the EXE's location, you'd need to do something like get the "root" folder, then search from that folder down for the EXE.
Answered 02/04/2010 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity