Sign in to follow this  
Followers 0
Probs

Detecting drive letter in use help

4 posts in this topic

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites

Guys thats great, Thanks for your time, I found the DriveGet function 5 minutes too late !

Cheers again,

- J

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  
Followers 0