Sign in to follow this  
Followers 0
AlienStar

open a file with a program ........

7 posts in this topic

hello everybody

we know all when we wanna open any file with a specific program we use this script :

for example pdf file with adobe reader

Run("E:\Adobe reader\AcroRd32.exe E:\PDF\file.pdf")

and it works well

something else :

when we wanna open a program or a file is existed in cdrom & don't know the name of drive we use :

$var = DriveGetDrive( "CDROM" )
If not @error Then
For $i = 1 to $var[0]
Run($var[$i] & "\Adobe reader\AcroRd32.exe")
Next
EndIf

also it woks well

but now :

if cdrom has these directories & files :

Adobe reader\AcroRd32.exe

PDF\file.pdf

how can I open file.pdf with AcroRd32.exe ???????

I tried this script but it didn't work :

$var = DriveGetDrive( "CDROM" )
If not @error Then
For $i = 1 to $var[0]
Run($var[$i] & "\Adobe reader\AcroRd32.exe" & $var[$i] & "\pdf\1.pdf")
Next
EndIf

please help meeeeeeeeeeeeeeee ....

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Run($var[$i] & "\Adobe reader\AcroRd32.exe|<--SPACE-->|" & $var[$i] & "\pdf\1.pdf")

EDIT:

ShellExecute("...\1.pdf")

oh my gad the missed thing is Space !!!!

it works thanks so much

but : what do you mean in : ShellExecute("...\1.pdf") ??

Edited by AlienStar

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

no I don't mean that ..

I put a space as you said and it works very well

do have I to use ShellExecute("E:\pdf\1.pdf") ???

Edited by AlienStar

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

thanks so so so much Yashied for help

I love Autoit Forum :( >_< :(

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  
Followers 0