Jump to content
Sign in to follow this  
kkman360

%CDROM%--newbie

Recommended Posts

More details please what you are trying to do and what you would like to accomplish! :)


~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Share this post


Link to post
Share on other sites

More details please what you are trying to do and what you would like to accomplish! :)

i make a autosetup xp cd ,when setup complete it will autoinstall office , winrar.....

i want use autoit make a autoinstall file but cdrom letter will be d: or e: or f:

i can use %cdrom% to get cdrom letter in xp command line,but i don't know how to use it in autoit3.

i would you can understand what i mean,beauce my english is not good.

thanks !

Share this post


Link to post
Share on other sites

ok !i try it .thanks!

Now that I think about it, if you want this pure AutoIt:

DriveGetDrive() in the Beta Help file

$var = DriveGetDrive( "CDROM" )
If NOT @error Then
    MsgBox(4096,"", "Found " & $var[0] & " drives")
    For $i = 1 to $var[0]
        MsgBox(4096,"Drive " & $i, $var[$i])
    Next
EndIf

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

$var = DriveGetDrive( "CDROM" )

If NOT @error Then

MsgBox(4096,"", "Found " & $var[0] & " drives")

For $i = 1 to $var[0]

MsgBox(4096,"Drive " & $i, $var[1])

Next

EndIf

Run("$var[1]\software\office\setup")

but it can't work .

Share this post


Link to post
Share on other sites

$var = DriveGetDrive( "CDROM" )

If NOT @error Then

MsgBox(4096,"", "Found " & $var[0] & " drives")

For $i = 1 to $var[0]

MsgBox(4096,"Drive " & $i, $var[1])

Next

EndIf

Run("$var[1]\software\office\setup")

but it can't work .

Hmm, is that a setup.exe?

I have never played with it before but I suppose you could try this.

$var = DriveGetDrive( "CDROM" )
If NOT @error Then
    $OptRun = Opt('RunErrorsFatal', 0)
    If $var[0] = 1 Then 
        Run('"' & $var[1] & '\software\office\setup.exe' & '"')
    Else
        For $i = 1 to $var[0]
            Run('"' & $var[$i] & '\software\office\setup.exe' & '"')
            If @error = 1 Then ExitLoop
        Next
    EndIf
    Opt('RunErrorsFatal', $OptRun)
EndIf
Sometimes you have to surround in quotes for a call like that. Might also want to look at Filename under Run in the help file to see what kind of files you can use with it.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

If executing the script from the CDRom, then a path using @ScriptDir should be enough.

I install from Cmdlines.txt with a script in the same directory that installs software from a subdirectory, and I use

@ScriptDir & '\Software\setup.exe'

to install.

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  

×
×
  • Create New...