Get OS version of external drive batch

January 9, 2011 at 19:25:40
Specs: Windows 7 Ultimate, 4.17Ghz 8GB ram
I need a batch file to get the operating system version of an external drive.

I can do this by looking at the file structure but i need batch to know it so i can run another command.

Thank you
Rocky3598


See More: Get OS version of external drive batch

Report •

#1
January 10, 2011 at 00:33:37
Windows XP: C:\Documents and Settings..
Windows Vista: C:\Users..

So you maybe can determine it;

::SCRIPT.bat

@echo off
if exist "C:\Documents and Settings" ECHO THIS MIGHT BE A WINDOWS XP
if exist "C:\Users" ECHO THIS MIGHT BE A WINDOWS VISTA.
pause
exit

Happy is ONE who says I am an OttoMAN.


Report •

#2
January 10, 2011 at 00:48:50
Try this;

::SCRIPT.bat

@echo off
for /f "tokens=*" %%j in ('"wmic os get name"') do set NAME="%%j"
for /f "tokens=*" %%j in ('"wmic os get RegisteredUser"') do set REGISTEREDUSER="%%j"
for /f "tokens=*" %%j in ('"wmic os get Description"') do set DESCRIPTION="%%j"
for /f "tokens=*" %%j in ('"wmic os get InstallDate"') do set INSTALLDATE="%%j"
echo.
echo %NAME%
echo.
echo %REGISTEREDUSER%
echo.
echo %DESCRIPTION%
echo.
echo %INSTALLDATE%
echo.
pause
exit

Happy is ONE who says I am an OttoMAN.


Report •

#3
January 10, 2011 at 04:40:52
I'm assuming in the parenthesis is where i put the drive letter?

Report •

Related Solutions

#4
January 10, 2011 at 05:13:13
That's the problem, its for the local disks :(

Try the first script? @ reply #1

Happy is ONE who says I am an OttoMAN.


Report •

#5
January 10, 2011 at 11:33:29
That's what i though but i wasn't sure if I was missing something. Isn't there a file that tells windows what version it is? Also is there any way for me to get what the profile names are? i know i can search for something thing like the if exist statement but can i get the names and turn them into variables?

Thanks for all the help


Report •

#6
January 11, 2011 at 00:36:47
Try this;

@echo off
echo.
for /f "tokens=*" %%j in ('wmic os get name') do set OS="%%j"
echo.
echo Operating System(s): %OS%
echo.
echo Profiles:
echo.
net user
echo.
pause
exit

Happy is ONE who says I am an OttoMAN.


Report •

Ask Question