Jump to content

Detecting drive letter in use help


Probs
 Share

Recommended Posts

Hi guys n gals,

I'm looking for a spot of advice. I'm trying to write a script which detects the presense of a drive (Physical or mapped) under the letter F, if the drive doesn't exist I need to map one in order to make a rather gash uninstaller, well, uninstall.

I had a search but couldn't find anything/ I'm sure someone has done this before I just can't see where.

Anyone got any ideas ?

Cheers in advance,

- J

Link to comment
Share on other sites

Hi guys n gals,

I'm looking for a spot of advice. I'm trying to write a script which detects the presense of a drive (Physical or mapped) under the letter F, if the drive doesn't exist I need to map one in order to make a rather gash uninstaller, well, uninstall.

I had a search but couldn't find anything/ I'm sure someone has done this before I just can't see where.

Anyone got any ideas ?

Cheers in advance,

- J

Look in the help file at the various DriveGet* functions.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

dummy =  DriveGetType("J:")
If @error Then
    ; @error <> 0 tells us the drive wasn't mapped
    DriveMapAdd("J:", "\\NeXT\tapioca", 0, "name", "pass")
    $unmap = 1  ;  Note that we didn't have an existing map
EndIf

Run("J:\uninstall.exe --silent", "J:")

If $unmap Then
    ; Disconnect drive 
    DriveMapDel("J:")
EndIf

Edit: There should probably be something like a For loop before the Run that tests for the existence of the target on the mapped drive, Sleeps and tests again until success or timeout, in case the drive mapping process isn't stabilized by the time that Run is called.

Edited by DaveF

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

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