manmoncang Posted May 4, 2006 Share Posted May 4, 2006 Sorry again coz i weak in programming. Just beginner i have a file in CD and i want open that file using GUI. Let's say the file name is file.pdf The problem is, not all computer assign same character for CD Drive like in my laptop, it is E:\ and my Dekstop is I:\ and so on Thus how to makesure when people press button in GUI, thus the computer know the CD drive and open that file. Tq Link to comment Share on other sites More sharing options...
Valuater Posted May 4, 2006 Share Posted May 4, 2006 (edited) maybe... put this first, change the use to PDF files $var = FileOpenDialog($message, "C:\Windows\", "Images (*.jpg;*.bmp)", 1 + 4 ) If @error Then MsgBox(4096,"","No File(s) chosen") Else $var = StringReplace($var, "|", @CRLF) MsgBox(4096,"","You chose " & $var) EndIf 8) Edited May 4, 2006 by Valuater Link to comment Share on other sites More sharing options...
nfwu Posted May 4, 2006 Share Posted May 4, 2006 Here: $file_relative_path = "myfolder\myotherfolder\myfile.pdf" $drive="<not_known>" For $i = Asc('a') to asc('z') If DriveGetType ( Chr($i) & ":" ) = "CDROM" And DriveStatus ( Chr($i) & ":" ) = "READY" Then $drive = Chr($i) ExitLoop EndIf Next If $drive="<not_known>" Then MSGBOX(0, "No CDROM found", 'Sorry =.="') EndIf Run('run "'&drive&':\'&$file_relative_path&'"') #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now