Jump to content

Recommended Posts

Posted

Hi All,

In DOS batch file, I used this command ,

rem Win2K/XP

if %SystemDrive%==C: goto C_Drive

if %SystemDrive%==D: goto D_Drive

rem Win9x

if %windir% == C:\WINDOWS

if %windir% == D:\WINDOWS

How to do this in Autoit?

Thanks

Ran

Posted (edited)

$systemdir = EnvGet("SystemDrive")

select
    case $systemdir == "C:"
        MsgBox(0,"", "System Dir is C:")

    case $systemdir == "D:"
        MsgBox(0,"", "System Dir is D:")

    case else
        MsgBox(0,"", "Unknown - " & $systemdir)
EndSelect

If you're needs are simple then you could just use

if $systemdir == "C:" then ... endif
instead of the select statement

EDIT: The above is valid AutoIt 3 code - worth upgrading?

Edited by GrahamS

GrahamS

Posted

Hi everyone,

Thanks for the help. I manage to get it work.

Ran

×
×
  • Create New...