Jump to content

Script To Detect All Available Drives On PC..?


Recommended Posts

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

Link to post
Share on other sites

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

Search the helpfile for DriveGetDrives() Edited by spudw2k
Link to post
Share on other sites

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

Link to post
Share on other sites

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
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...