/build/static/layout/Breadcrumb_cap_w.png

Read path from root or previous folder

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

Answers (4)

Posted by: anonymous_9363 14 years ago
Red Belt
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"
Posted by: Yaduveer 14 years ago
Orange Senior Belt
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
Posted by: Yaduveer 14 years ago
Orange Senior Belt
0
Got it..

for going to 1 previous folder, we have to put "..\"
Posted by: anonymous_9363 14 years ago
Red Belt
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.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ