I want to get the Windows on disk

April 10, 2011 at 06:34:35
Specs: Windows 7, Intell core2quad 2.4 / 4gb
I want to know is there a batch that can tell you what the current loaded windows is?

If I have win xp on it would say windows xp 32bit build ---

Same with vista and win7.

Is there such a command?

Then also want to know is it easier to create a vb script to run my program as admin, because with cmd it prompts me for a password. Is there a way that I can enter my password into the bat file, or would it be easier to look into another language?


See More: I want to get the Windows on disk

Report •

April 10, 2011 at 13:20:09
msinfo32 and winver are GUI commands which will show your windows OS name/ver.

yes, You can use Vbscript. may be you can combine VBscript with bat file so it would be a .bat executing vbscript in backend.

if you know basic VBscript below would be an idea ..

i) execute the runas command from bat.
ii) wait for about 1-2 secs (wscript.wait)
iii) Send the password using wshshell.sendkeys method.

Subhash Chandra.

Report •

April 10, 2011 at 13:55:03
wmic can handle this and it's built in since XP Professional and later, but you will need administrator rights.

wmic os get name

Script usage:

@echo off
for /f "tokens=*" %%j in ('wmic os get name') do set OS=%%j
echo %OS%


Happy is ONE who says I am an OttoMAN.

Report •

April 11, 2011 at 05:49:44
Thanks MU's and Subhash. Would like to ask you one more question. I have seen when using the runas command in cmd, it asks for a password, even if there is no password present on the admin account. Any way to disable it in asking for a password? Otherwise I would use the vb script. Thanks

Report •

Related Solutions

April 11, 2011 at 18:26:36
As per my understanding if there is no password assigned for admin (or anyuser) run as command (Secondary log on service) or any other program will not not let you use that account. Blank password does not work for authentication. Like if there is no password for the account admin you can not RDP, UNC or telnet etc using that account.

Subhash Chandra.

Report •

Ask Question