Jump to content
Sign in to follow this  
cypher175

Script To Detect All Available Drives On PC..?

Recommended Posts

cypher175

Anybody know how I would go about coding a script to detect all the available drives on a PC: Fixed, Removable, USB, CD-DVD Ect..

And for each drive found I want to copy a file over to it..

Anyone know what Commands or Functions I would need to use for something like this..??

Share this post


Link to post
Share on other sites
spudw2k

Anyone know what Commands or Functions I would need to use for something like this..??

Search the helpfile for DriveGetDrives() Edited by spudw2k

Share this post


Link to post
Share on other sites
cypher175

ok thanks...

so far i got this, but its not working though, whats wrong with it..??

I think its the "Drive" Variable, what am i suppose to use instead, so it copies "C:\0\1.txt" to all found drives..??

$var = DriveGetDrive( "all" )

If NOT @error Then

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

For $i = 1 to $var[0]

FileCopy("C:\0\1.txt", "Drive", 1 )

Next

EndIf

Share this post


Link to post
Share on other sites
UltraFine

ok thanks...

so far i got this, but its not working though, whats wrong with it..??

I think its the "Drive" Variable, what am i suppose to use instead, so it copies "C:\0\1.txt" to all found drives..??

try this

$DISK = DriveGetDrive("ALL")
For $I = 1 To $DISK[0]
    $STATUS = DriveStatus($DISK[$I])
    If $STATUS = "ready" Then
        FileCopy("C:\New\File.txt", $DISK[$I] & "\File.txt")
    EndIf
Next

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.