Jump to content

%CDROM%--newbie


Recommended Posts

  • Moderators

how to use "%cdrom%" in autoit3?

thanks!

Opt('ExpandEnvStrings', 1)

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.

Link to comment
Share on other sites

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

Link to comment
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 !

Link to comment
Share on other sites

  • Moderators

You can use %cdrom% just like that with the Opt I showed.

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.

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
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 .

Link to comment
Share on other sites

  • Moderators

$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.

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...