Identify hard drives

(imported topic written by pcaprio91)

Good Afternoon,

I am creating a custom task to run a command to gather information on a system’s C:\ drive and output it to a file.

While searching the forum under Fixlet Authoring, I was able to modify some relevance I found to get the drive letters.

( preceding text of last “:” of following text of first “%22” of (Property “Dependent” of it as string)& “:”)of select objects “* from Win32_LogicalDiskToPartition” of wmi

How can I incorporate this information into the task, so the command can run on the drives found on the system.

Then output that information to a text file with their respective drive letter that the command ran on?

Thx

(imported comment written by BenKus)

Hey pcaprio,

I think maybe this relevance would work better:

names of drives whose (type of it = “DRIVE_FIXED”)

But to incorporate that in an action, you need to use a trick to make a batch file with the command you want and execute the batch file…

Here is an example that seems close to what you want:

http://forum.bigfix.com/viewtopic.php?id=4260

Ben

(imported comment written by pcaprio91)

thx.

I have been trying to tweak the info you sent, but having problems.

So far, this is what I got

extract fcivexe.tmp

move __Download\fciv.exe c:\fciv.exe

// clear out temp files that might be there

delete fciv.bat

delete __appendfile

// create a bat file by iterating across the different files

appendfile c:\fciv.exe {names of drives whose (type of it = “DRIVE_FIXED” and name of it != “C:”)}\ -r -both >> C:{hostname}.FCIV.{names of drives whose (type of it = “DRIVE_FIXED” and name of it != “C:”)}_drive.txt

appendfile c:\fciv.exe {names of drives whose (type of it = “DRIVE_FIXED” and name of it != “D:”)}\ -r -both >> C:{hostname}.FCIV.{names of drives whose (type of it = “DRIVE_FIXED” and name of it != “D:”)}_drive.txt

but when I run it thru the fixletdebugger, I get the output of

Appending to File c:\fciv.exe D:S:\ -r -both >> C:<system name>.FCIV.D:S:_drive.txt

Appending to File c:\fciv.exe C:S:\ -r -both >> C:<system name>.FCIV.C:S:_drive.txt

C:\ and D:\ are 2 partitions on a sigle drive.

Is this why I am seeing this?

How can I adjust this?

(imported comment written by BenKus)

Try something like this:

appendfile {("C:\fciv.exe " & it & “\ -r both >> C:” & hostname & “.fciv.” & preceding text of first “:” of it & “_drive.txt” & “%0d%0a” ) of names of drives whose (type of it = “DRIVE_FIXED”)}

Ben