Login Register






Quick Drive Information - Developed by PhazeShift filter_list
Author
Message
Quick Drive Information - Developed by PhazeShift #1
Here's a quick script I finished this past week. It returns drive information (basic) and allows you the option to export it to a text file in the directory that you ran the script.

[Image: ibcrx8FIm8ohG.png]

Code:
@echo off title Quick Drive Information SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION call :AppInfo > %windir:~0,2%\drive_info.txt for %%G in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do ( fsutil fsinfo drivetype %%G: | find "Fixed" > nul 2>&1 && echo %%G: Drive [Fixed Drive]: >> %windir:~0,2%\drive_info.txt fsutil fsinfo drivetype %%G: | find "CD-ROM" > nul 2>&1 && echo %%G: Drive [Removable Drive] >> %windir:~0,2%\drive_info.txt && echo. >> %windir:~0,2%\drive_info.txt fsutil fsinfo volumeinfo %%G: | find "File System Name : NTFS" > nul 2>&1 && call :NTFSInfo %%G >> %windir:~0,2%\drive_info.txt ) type %windir:~0,2%\drive_info.txt echo This is the end of the results... set /p userinput=Would you like to keep these results by creating a file? [Y/N] if /i "!userinput:~0,1!"=="y" goto Exp del "%windir:~0,2%\drive_info.txt" goto :eof :Exp echo Exporting data to text file: echo. %~dp0drive_info.txt @move /Y %windir:~0,2%\drive_info.txt %~dp0 goto :eof :NTFSInfo for /f "tokens=7 delims=: " %%B in ('fsutil volume diskfree %*:') do ( echo. -- FileSystem for drive /%%G: NTFS echo. -- Free Space: %%B bytes ) echo. && goto :eof :AppInfo ( echo Quick Drive Information - [%Date%] echo Developed by AceInfinity 2012 - http://tech.reboot.pro echo. )
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]

Reply