Finding the install path?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
buckw1
Junior Coder
Posts: 20
Joined: Sun Sep 18, 2005 5:08 am

Finding the install path?

Post by buckw1 » Sat Jan 28, 2006 7:57 am

I know I'll feel dumb when I see the answer, but I've searched this site and found nothing even close.

How can I make this into a simple loop rather than having 24 if statements?

/// Find Install Directory ////////////
//////////////////////////////////////////////////

IfDirExists>C:\script
Let>v_Install=C:\script
GoTo>CONFIG_INSTALL_END
Endif
IfDirExists>D:\script
Let>v_Install=D:\script
GoTo>CONFIG_INSTALL_END
Endif
IfDirExists>E:\script
Let>v_Install=E:\script
GoTo>CONFIG_INSTALL_END
Endif
.......and so on to Z

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Jan 28, 2006 3:31 pm

Like so:

VBSTART
VBEND

Let>c=65
Repeat>c
VBEval>Chr(%c%),drive
IfDirExists>%drive%:\script
Let>v_Install=%drive%:\script
Goto>CONFIG_INSTALL_END
Endif
Let>c=c+1
Until>c=91
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

buckw1
Junior Coder
Posts: 20
Joined: Sun Sep 18, 2005 5:08 am

Post by buckw1 » Sun Jan 29, 2006 2:46 am

And of course I never even thought of VB

Thanks!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts