02-08-2012, 07:32 AM
Here's a quick script I've been working on for the past 20 minutes. 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.
Enjoy
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
echo.
)
Enjoy