Sign in to follow this  
Followers 0
Qual-IT London

compress

7 posts in this topic

anyone know if its possible to getdrivefilesystem to see if the drive is NTFS compressed?

Share this post


Link to post
Share on other sites



straight from help

DriveGetFileSystem

--------------------------------------------------------------------------------

Returns File System Type of a drive.

DriveGetFileSystem ( "path" )

Parameters

path Path of drive to receive information from.

Return Value

Success: Returns the File System Type of the drive as a string; see table below.

Failure: Sets @error to 1.

Return Value Interpretation

1 (numeric) Drive does NOT contain media (CD, Floppy, Zip) or media is unformatted (RAW).

"FAT" Typical file system for drives under ~500 MB such as Floppy, RAM disks, USB "pen" drives, etc.

"FAT32" Typical file system for Windows 9x/Me hard drives.

"NTFS" Typical file system for Windows NT/2000/XP hard drives.

"NWFS" Typical file system for Novell Netware file servers.

"CDFS" Typically indicates a CD (or an ISO image mounted as a virtual CD drive).

"UDF" Typically indicates a DVD.

you have been here long enough to search help

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

straight from help

you have been here long enough to search help

8)

I believe the question is whether the NTFS has compression enabled or not. As far as I know, this is not addressed in the help file. There mgiht be a COM soultion.....


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

I believe the question is whether the NTFS has compression enabled or not. As far as I know, this is not addressed in the help file. There mgiht be a COM soultion.....

If so.... i appologize,,, sometimes i read a little to quickly

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Until someone find a way to do it with COM or DllCall...

Here is a workaround.

#include <Constants.au3>

$folder = 'C:\Compressed\' ;need to have trailing slash for folder
$compress = False

$foo = Run(@ComSpec & " /c compact /Q " & $folder, @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

While 1
    $line = StdoutRead($foo)
    If @error = -1 Then ExitLoop
    ConsoleWrite("STDOUT read:" & $line & @LF)
    If StringInStr($line,"will be compressed.") Then $compress = True
Wend

While 1
    $line = StderrRead($foo)
    If @error = -1 Then ExitLoop
    MsgBox(0, "STDERR read:", $line)
Wend

If $compress Then 
    MsgBox(0, "", $folder & " is compressed")
Else 
    MsgBox(0, "", $folder & " is NOT compressed")
EndIf

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