Just to reiterate, I want to have IORRT and Check.bat/theme stuff ALL in one Rearm folder in %systemdrive% This will require error checking as to the existance or non-existance of rearm folder for both install and unistall for IR6/IORRT stuff IR6 part is started, IORRT is not started!
Needs to be %%a and %%c and only shows "Home" or "Professional" mostly with a space. Using here: Code: @Echo Off for /f "tokens=2,3,4,5,6,7 delims= " %%a in ('wmic os get caption') do set ver=%%a %%b %%c %%d %%e %%f :loopV if "%ver:~-1%"==" " set "ver=%ver:~0,-1%" & goto :loopV echo version: %ver%# pause Output on my Win 8 Pro WMC: Code: version: Windows 8 Pro with Media Center# Drücken Sie eine beliebige Taste . . . Output on Win 7 Home Basic: Code: version: Windows 7 Home Basic# Press any key to continue . . . No spaces...no errors .
Not sure what you are getting at there s1ave. I get: Code: version: Windows 7 Ultimate# when using the code you posted. Are you trying to remove the # symbol? Are you saying the code I posted only gives you HOME for home basic cause I removed the extra's? If so then just add %C and %D and you will get HOME BASIC as for trying to get it to work with Windows 8 anything, this is made for Windows 7 and doesn't require support for 8.
The line I posted shows the full VER= line for me. Code: for /f "tokens=2,3,4 delims= " %a in ('wmic os get caption') do set ver=%c For "Home Premium" and "Home Basic" It may only show ver=home so just need to add this "ver=%c %d" I think.
Nope, the "#" symbol is only to check there are no spaces in %ver%. In your case shows the correct output for Win 7 Ultimate. Using 'for'-loop in a single line makes no sense for me . Test the code snipplet from my earlier post.
Here (Win 8 Pro WMC) it shows: Code: Microsoft Windows [Version 6.3.9431] (c) 2013 Microsoft Corporation. All rights reserved. C:\Windows\system32>for /f "tokens=2,3,4 delims= " %a in ('wmic os get caption') do set ver=%c C:\Windows\system32>set ver= C:\Windows\system32>set ver=Pro C:\Windows\system32>
Code: Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Windows\system32>for /f "tokens=2,3,4 delims= " %a in ('wmic os get caption') do set ver=%c C:\Windows\system32>set ver= C:\Windows\system32>set ver=Home C:\Windows\system32>
Did you try adding that little bit extra I posted? for /f "tokens=2,3,4 delims= " %a in ('wmic os get caption') do set ver=%c %d
Code: 76 65 72 3D 57 69 6E 64 6F 77 73 20 37 20 48 6F 6D 65 20 42 61 73 69 63 20 0D 20 That's the Home Basic string, with 0x20 0x0D 0x20 at the end. I will, but I forgot to cut the network for the VMs, only for them deciding to install 100+ Windows updates.
'wmic os get caption' can contain 6 words max so far i tested, e.g. 'Windows 8 Pro with Media Center'. First value is not needed, so it starts from 2 to 7. The loop afterwards cuts off any empty space in case only 4 words are used, e.g. 'Windows 7 Home Basic'.
Well if this is a version check, and you want the FULL line of 'Windows 7 "Edition here"' then okay, have it your way-but I say its not needed cause the batch file checks to see if your running windows 7 already. But I also will say that I haven't tested this on any OS other then my current OS (none-vm) so I do not know. Code: REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion | FINDSTR 6.1 >NUL IF %ERRORLEVEL% NEQ 0 CLS & echo Supports only windows 7 and server 2008 R2 & ping -n 5 127.0.0.1 >nul & goto mainmenu
I stand corrected on my previous post. I test my code in Home Premium and only got it to show "HOME %D" which I am sure I could get it to work right but oh well.. Post/Upload to DB the rearm script so that I can use in a VM please.
I already have ver 3 of check.bat test. I need the rearm script that you using to for into notifications mode. If you still have/use it.
Ahhh...you may mean such one Code: @echo off CLS mode con: cols=50 lines=12 >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" if '%errorlevel%' NEQ '0' ( echo Requesting administrative privileges... goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" set params = %*:"="" echo UAC.ShellExecute "%~s0", "%params%", "", "runas", 1 >> "%temp%\getadmin.vbs" "%temp%\getadmin.vbs" exit /B :gotAdmin if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" ) setlocal ENABLEDELAYEDEXPANSION :RearmIR6 mode con: cols=62 lines=7 CLS echo ...Rearming :) cscript.exe /b %windir%\system32\slmgr.vbs /rearm net stop sppsvc >NUL net start sppsvc >NUL cscript.exe /b %windir%\system32\slmgr.vbs /rearm net stop sppsvc >NUL net start sppsvc >NUL cscript.exe /b %windir%\system32\slmgr.vbs /rearm net stop sppsvc >NUL net start sppsvc >NUL cscript.exe /b %windir%\system32\slmgr.vbs /rearm net stop sppsvc >NUL net start sppsvc >NUL cscript.exe /b %windir%\system32\slmgr.vbs /rearm net stop sppsvc >NUL net start sppsvc >NUL slmgr /dlv ENDLOCAL exit You still need to forward time afterwards.