Jump to content
Sign in to follow this  
junah

Run Commands questions

Recommended Posts

junah

Hi everybody,

I'm searching about the way to launch a software stored in a directory named PROG, and the softwares can be in serverals drive letter.

My script begins like that:

;Launch audacity.exe who is in D:\prog directory

Run("D:\prog\audacity.exe")

After, I'd like to put my script on a dvd, but the path will change:

The drive letter will change, but not the folder (PROG)

i think the script may be something like that :

Run("%prog\audacity.exe%")

Can you help me please ?

Thanks.

Edited by junah

Share this post


Link to post
Share on other sites
nfwu

For $i = Asc('a') to Asc('z')
   If FileExists(Chr($i) & ":\prog\audacity.exe") Then Run(Chr($i) & ":\prog\audacity.exe")
Next

#)

Share this post


Link to post
Share on other sites
junah

Thanks a lot nfwu, i'll test the code now.

It's ok

here's the beginnig :

; Install automatisée de AUDACITY

;

; History :

; 12 Septembre 2006 : Audacity version 1.2.4b FR

;

For $i = Asc('a') to Asc('z')

If FileExists(Chr($i) & ":\prog\audacity.exe") Then Run(Chr($i) & ":\prog\audacity.exe")

Next

WinwaitActive("Setup - Audacity","Welcome to the Audacity Setup Wizard")

send("!n")

;scrip not finished

Exit

This works, and i try to move the folder on the C: Drive and it works, thank you !

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.