Hi, was curious if there was any wmic way to open personalization window with .vbs or something that could be written in batch And if so can the personalization window also be closed as well via same wmic Thanks
Win + R, then put this command: Code: control /name Microsoft.Personalization The personalization window will appear... Or just "control" /name Microsoft.Personalization on the batch file as a simple command.
Thank you JC Code: control /name Microsoft.Personalization And mostly I want to know how to close the personalization window I'm reading this page Thanks
This also opens up personalization window Code: control desktop But my goal it to have that window not open when theme is installed or at least to close it after it's opened And I think that perhaps wallpaper installation does not require personalization window to be opened, I'm not sure? Here are the two threads I found: 1. http://www.sevenforums.com/themes-styles/93397-there-silent-command-line-operation-change-theme.html 2. http://www.sevenforums.com/general-...create-windows-batch-file-do.html#post1859923 The first gives this script to close personalization window Code: Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:""C:\Windows\Resources\Ease of Access Themes\classic.theme""" Wscript.Sleep 10000 WshShell.AppActivate("Desktop Properties") WshShell.Sendkeys "%FC" WshShell.Sendkeys "{F4}" and the second uses this code to close the personalization window Code: timeout 6 taskkill /fi "WINDOWTITLE eq Personalization" Basically my Rearm Wizard project restores theme/wallpaper, thus opening personalization window thus it would be nice to close it automatically
@Timesurfer, are you using Win7? , I have a .js script and .cmd that launches the theme plus closes the personalization pop-up in Win8, have not tested on Win7..DP Posted on msfn >>http://www.msfn.org/board/topic/163668-auto-enable-win8-theme-without-popup-box/
So I'll be starting with this and adapting it to Rearm Wizard here ClosePersonalizationWindow.vbs Code: Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:""C:\Windows\Resources\Ease of Access Themes\classic.theme""" Wscript.Sleep 1600 WshShell.AppActivate("Desktop Properties") WshShell.Sendkeys "%FC" WshShell.Sendkeys "{F4}" Thanks JC for getting me started, hopefully I can put this code or a similar code into the theme/wallpaper restore part of Rearm Wizard final version... I missed seeing your post and am going to go look at now! Thanks p.s Can you post the code that would be used in batch please here so I don't have to join that site!
Here is what I am doing from Powershell for my unattend, very similar. Code: C:\Windows\Setup\Scripts\BLACK_SILENCE_NO_SCREENSAVER_2012_R2.deskthemepack Start-Sleep 5 [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic');[Microsoft.VisualBasic.Interaction]::AppActivate("Personalization") [void][System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms');[System.Windows.Forms.SendKeys]::SendWait("%{F4}") http://www.msfn.org/board/topic/163857-reqchange-theme-not-working/
Try this..DP Code: 'SETS SPECIFIED THEME THEN CLOSES OUT PERSONALIZATION WINDOW 'Set.theme.vbs ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run "%windir%\\resources\\themes\\classic.theme" Wscript.Sleep 1000 WshShell.AppActivate("Desktop Properties") WshShell.Sendkeys "%FC" WshShell.Sendkeys "{F4}"
Hi Mr Jinje, have watched you contribute greatly here at MDL and have admired your coding for years now I am not an expert like you so would you explain to me what this does please As I've stated I'm restoring theme/wallpaper and of course the personalization window (pw) pops up So I'll have to somehow apply one of these close (pw) in correct timing after theme/wallpaper has been restored I am uncertain on how to do this and would appreciate any help Here is the latest Rearm Wizard Thanks Missed your post again Thank you If you guys are into it it would be easier for me to help me in my Rearm Wizard thread where these codes will be assimilated into RW
@Dos_Probie It works and closes itself, now to just figure where to assimilate it into RW Thank you for your time and code TS Thanks, I will go look where to put these code of you guys into Rearm Wizard
Those might need some testing, I deleted the post after it didn't play out the same from double click a batch file vs paste into command window.
Here's how it's going to be in Rearm Wizard which writes to IR72.bat To test: Install these folders Code: md %systemdrive%\Trial md %systemdrive%\Trial\IR7 Code: echo echo Set WshShell = WScript.CreateObject("WScript.Shell") ^>^>close.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo WshShell.Run "%windir%\\resources\\themes\\classic.theme" ^>^>close.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo Wscript.Sleep 2600 ^>^>close.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo WshShell.AppActivate("Desktop Properties") ^>^>close.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo WshShell.Sendkeys "%%%%FC" ^>^>close.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo WshShell.Sendkeys "{F4}" ^>^>close.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo call close.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo del close.vbs >>%SystemDrive%\Trial\IR7\IR72.bat start %SystemDrive%\Trial\IR7\IR72.bat
Other Methods You could also thing about instead of running from the system drive or a protected directory to instead use the temp directory to run your vbs like so.. Code: :: Run vbs direct from batch to temp then delete vbs file.. echo Set WshShell = WScript.CreateObject("WScript.Shell") > %tmp%\set_theme.vbs echo WshShell.Run "%windir%\\resources\\themes\\classic.theme" >> %tmp%\set_theme.vbs echo Wscript.Sleep 1000 >> %tmp%\set_theme.vbs echo WshShell.AppActivate("Desktop Properties")>> %tmp%\set_theme.vbs echo WshShell.Sendkeys "%%FC" >> %tmp%\set_theme.vbs echo WshShell.Sendkeys "{F4}" >> %tmp%\set_theme.vbs wscript.exe %tmp%\set_theme.vbs del %tmp%\set_theme.vbs Or just set your specified theme directly from your main batch which is more direct and faster..DP Code: :themeset :: Set path to theme directory.. set TargetDir="%windir%\resources\themes" pushD "%~dp0" & cd /d "%~dp0" :: Activate specified theme.. cd /d %TargetDir% start "" classic.theme timeout /t 1 /nobreak>nul :: Kill Personalization.. taskkill /f /im explorer.exe>nul start explorer.exe>nul popD
Come over to the Rearm Wizard thread and help me, since testing this in RW is the real test... But I don't want task bar to disappear but faster would be better since the process of creating/calling/deleting close.vbs is kinda long so come help me in my thread Thanks
lol...This sometimes actually closes windows explorer instead of personalization window ...lol Code: echo echo Set WshShell = WScript.CreateObject("WScript.Shell") ^>^>twrpwc.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo WshShell.Run "%windir%\\resources\\themes\\IR7Bkup.theme" ^>^>twrpwc.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo Wscript.Sleep 10000 ^>^>twrpwc.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo WshShell.AppActivate("Desktop Properties") ^>^>twrpwc.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo WshShell.Sendkeys "%%%%FC" ^>^>twrpwc.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo WshShell.Sendkeys "{F4}" ^>^>twrpwc.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo call twrpwc.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo del twrpwc.vbs >>%SystemDrive%\Trial\IR7\IR72.bat
So this personalization window close after theme install concept has been working pretty well To explain in detail: 1. After onlogon/restart if in notifications theme will install, thus causing personalization window to open, thus it must be closed 2. The code being utilized will initiate theme restore then personalization window will open but sometimes the personalization window at startup/onlogon will freeze due to the programs starting up inside windows thus in my testing the personalization window remains open because there is a timing code that starts after theme is restore and if personalization window isn't completely open the theme may not restore and personalization window my not close 3. I did however in testing note that if I use the cmd Code: control desktop prior to theme restore things seem to go more smoothly I have even set the time delay to 7000 reboot or logooff and theme seems to install faster and personalization window seems to always close so the code looks like this now Code: echo control desktop >>%SystemDrive%\Trial\IR7\IR72.bat echo echo WshShell.Run "%windir%\\resources\\themes\\IR7.theme" ^>^>%tmp%\IR7.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo Set WshShell = WScript.CreateObject("WScript.Shell") ^>^>%tmp%\IR7.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo WshShell.Run "%windir%\\resources\\themes\\IR7.theme" ^>^>%tmp%\IR7.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo Wscript.Sleep 7000 ^>^>%tmp%\IR7.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo WshShell.AppActivate("Desktop Properties") ^>^>%tmp%\IR7.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo WshShell.Sendkeys "%%%%FC" ^>^>%tmp%\IR7.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo echo WshShell.Sendkeys "{F4}" ^>^>%tmp%\IR7.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo call %tmp%\IR7.vbs >>%SystemDrive%\Trial\IR7\IR72.bat echo del %tmp%\IR7.vbs >>%SystemDrive%\Trial\IR7\IR72.bat I have also changed the path and name to twrpwc.vbs to %tmp%\IR7.vbs and the theme backup name to IR7.theme
I was just messing around with adding branding and themes to an already installed windows. If it helps heres the cmd i use. Im still tweaking it. Only tested on 8.1 x64. This part applies the theme and closes it without a vbs. Code: echo Set WshShell = WScript.CreateObject("WScript.Shell") >> %temp%\SetTheme.vbs echo WshShell.Run "%windir%\\resources\\themes\\%CustomOEM%.theme" >> %temp%\SetTheme.vbs echo Wscript.Sleep 1000 >> %temp%\SetTheme.vbs echo WshShell.AppActivate("Desktop Properties") >> %temp%\SetTheme.vbs echo WshShell.Sendkeys "%%FC" >> %temp%\SetTheme.vbs echo WshShell.Sendkeys "{F4}" >> %temp%\SetTheme.vbs cscript %temp%\SetTheme.vbs Code: @echo off set CustomOEM=BLACKMESA set ModelNameOfComputer=Research PC set SupportURL=http://www.blackmesasource.com/ Call :OobeInfo Call :OobeInfoReg Call :UserAccountPictures Call :Lockscreen Call :Themes rem :WALLPAPER rem Control.exe /name Microsoft.Personalization echo Set WshShell = WScript.CreateObject("WScript.Shell") >> %temp%\SetTheme.vbs echo WshShell.Run "%windir%\\resources\\themes\\%CustomOEM%.theme" >> %temp%\SetTheme.vbs echo Wscript.Sleep 1000 >> %temp%\SetTheme.vbs echo WshShell.AppActivate("Desktop Properties") >> %temp%\SetTheme.vbs echo WshShell.Sendkeys "%%FC" >> %temp%\SetTheme.vbs echo WshShell.Sendkeys "{F4}" >> %temp%\SetTheme.vbs cscript %temp%\SetTheme.vbs exit :OobeInfo MD "%windir%\system32\oobe\info" rem COPY /Y "%~dp0*.*" "%windir%\system32\oobe\info" COPY /Y "%~dp0Backgrounds" "%windir%\system32\oobe\info" COPY /Y "%~dp0*.jpg" "%windir%\system32\oobe\info" COPY /Y "%~dp0*.png" "%windir%\system32\oobe\info" COPY /Y "%~dp0*.bmp" "%windir%\system32\oobe\info" COPY /Y "%~dp0*.xml" "%windir%\system32\oobe\info" REM echo Below is for running the OEM reg instead of adding the reg entries via the CMD. rem FOR %%f IN (%~dp0*.reg) DO regedit.exe /S %%f rem RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters ,1 ,True goto :eof :OobeInfoReg REG ADD "HKCU\Control Panel\Colors" /v Background /T REG_SZ /D "0 0 0" /f REG ADD "HKU\.Default\Control Panel\Colors" /v Background /T REG_SZ /D "0 0 0" /f rem REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /V @ /T REG_SZ /D "" /F REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /V Logo /T REG_EXPAND_SZ /D "%Windir%\System32\oobe\info\%CustomOEM%_BADGE.bmp" /F REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /V Manufacturer /T REG_SZ /D "%CustomOEM%" /F REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /V Model /T REG_SZ /D "%ModelNameOfComputer%" /F REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /V SupportHours /T REG_SZ /D "24\7" /F REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /V SupportPhone /T REG_SZ /D "1-800-892-5234" /F REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /V SupportURL /T REG_SZ /D "%SupportURL%" /F REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winsat\WindowsExperienceIndexOemInfo" /V Logo /T REG_EXPAND_SZ /D "%Windir%\System32\oobe\info\%CustomOEM%_BAR.bmp" /F REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winsat\WindowsExperienceIndexOemInfo" /V HardwareUpgradeURL /T REG_SZ /D "%SupportURL%" /F REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background /v OEMBackground /t REG_DWORD /d 1 /f REG ADD HKLM\SOFTWARE\Policies\Microsoft\Windows\System /v UseOEMBackground /t REG_DWORD /d 1 /f REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes /V "Drop Shadow" /T REG_EXPAND_SZ /D "FALSE" /F REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes /V "Flat Menus" /T REG_SZ /D "FALSE" /F REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes /V SetupVersion /T REG_SZ /D "10" /F REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes /V InstallTheme /T REG_SZ /D "%WINDIR%\resources\Themes\$OEM$.theme" /F REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes /V InstallVisualStyle /T REG_SZ /D "%WINDIR%\resources\Themes\Aero\Aero.msstyles" /F goto :eof :UserAccountPictures REN "%ProgramData%\Microsoft\User Account Pictures\user.bmp" "orig.bmp" REN "%ProgramData%\Microsoft\User Account Pictures\user.png" "orig.png" REN "%ProgramData%\Microsoft\User Account Pictures\user-40.png" "orig-40.png" REN "%ProgramData%\Microsoft\User Account Pictures\user-200.png" "orig-200.png" COPY /Y "%~dp0user.bmp" "%ProgramData%\Microsoft\User Account Pictures\user.bmp" COPY /Y "%~dp0user.bmp" "%ProgramData%\Microsoft\User Account Pictures\user.png" COPY /Y "%~dp0user.bmp" "%ProgramData%\Microsoft\User Account Pictures\user-40.png" COPY /Y "%~dp0user.bmp" "%ProgramData%\Microsoft\User Account Pictures\user-200.png" goto :eof :Lockscreen rem http://www.eightforums.com/tutorials/40669-lock-screen-default-background-image-change-windows-8-a.html TAKEOWN /F "%ProgramData%\Microsoft\Windows\SystemData\*.*" ICACLS "%ProgramData%\Microsoft\Windows\SystemData\*.*" /reset /T /Q TAKEOWN /F "%ProgramData%\Microsoft\Windows\SystemData\S-1-5-18\*.*" ICACLS "%ProgramData%\Microsoft\Windows\SystemData\S-1-5-18\*.*" /reset /T /Q TAKEOWN /F "%ProgramData%\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly\*.*" ICACLS "%ProgramData%\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly\*.*" /reset /T /Q TAKEOWN /F "%ProgramData%\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly\LockScreen_Z\*.*" ICACLS "%ProgramData%\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly\LockScreen_Z\*.*" /reset /T /Q MOVE /Y "%ProgramData%\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly\LockScreen_Z\*.jpg" "%temp%\LockScreen.jpg" TAKEOWN /F "%windir%\Web\Screen\*.jpg" ICACLS "%windir%\Web\Screen\*.jpg" /reset /T /Q MOVE /Y "%windir%\Web\Screen\img100.jpg" "%windir%\Web\Screen\original.jpg" COPY /Y "%~dp0WALLPAPER.jpg" "%windir%\Web\Screen\img100.jpg" TAKEOWN /F "%windir%\Web\Screen\*.png" ICACLS "%windir%\Web\Screen\*.png" /reset /T /Q MOVE /Y "%windir%\Web\Screen\img100.png" "%windir%\Web\Screen\original.png" COPY /Y "%~dp0WALLPAPER.jpg" "%windir%\Web\Screen\img100.png" goto :eof :Themes COPY /Y "%~dp0WALLPAPER.jpg" "%windir%\System32\OOBE\info\%CustomOEM%_WALLPAPER.jpg" TAKEOWN /F "%windir%\Resources\Themes\*.theme" ICACLS "%windir%\Resources\Themes\*.theme" /reset /T /Q ICACLS "%windir%\Resources\Themes\*.theme" /grant:r "%windir%\Resources\Themes\*.theme:(OI)(CI)F" REN "%windir%\Resources\Themes\aero.theme" "orig.theme" COPY /Y "%~dp0*.theme" "%windir%\Resources\Themes\aero.theme" COPY /Y "%~dp0*.theme" "%windir%\Resources\Themes\%CustomOEM%.theme" COPY /Y "%~dp0*.theme" "%windir%\Resources\Themes\$OEM$.theme" goto :eof :WALLPAPER TAKEOWN /F "%windir%\Web\Windows\*.jpg" ICACLS "%windir%\Web\Windows\*.jpg" /reset /T /Q MOVE /Y "%windir%\Web\Windows\img100.jpg" "%windir%\Web\Windows\original.jpg" COPY /Y "%~dp0WALLPAPER.jpg" "%windir%\Web\Wallpaper\Windows\Wallpaper.jpg" REG ADD "HKCU\Control Panel\Desktop" /V Wallpaper /T REG_SZ /D "%windir%\Web\Wallpaper\Windows\Wallpaper.jpg" /f goto :eof :SourcesTheseareJustExamples Echo These are the main file locations and the needed resolutions. Echo DONT RUN THIS ;OEM Branding in REG windows\system32\oobe\info\OOBE.xml ;Applies below Windows\system32\oobe\info\%CustomOEM%_BADGE.png ;oobe Logo 240x100 windows\system32\oobe\info\%CustomOEM%_BADGE.bmp ;OEM logo 120x120 windows\system32\oobe\info\%CustomOEM%_BAR.bmp ;Experience Index logo 120x50 ;Themes in REG %WINDIR%\resources\Themes\$OEM$.theme ;Custom Theme %WINDIR%\resources\Themes\Aero\Aero.msstyles ;Used by default %WINDIR%\System32\oobe\info\WALLPAPER.jpg ; Wallpaper in theme goto :eof