closing personalization window in CMD

Page 2 of 3 FirstFirst 123 LastLast

  1. My1
    Posts : 14
    Win7/8/10/Hackingtosh
    Thread Starter
       #11

    well quite some things, as well as my explorer process usually shows N/A (probably coz it's the one that connects to the desktop)

    also window handling cant be completely disturbed, coz I can still snipe that window down with taskmanager...
    Attached Thumbnails Attached Thumbnails closing personalization window in CMD-screenshot-10-.png  
      My Computer


  2. Posts : 3,257
    Windows 10 Pro
       #12

    Well, whatever the issue is... Taskkill can only work with whatever is listed in the process window title. If it's not there, it can't find it.

    So something is stealing your window title... and it doesn't do it on a normal vanilla system.
      My Computer


  3. My1
    Posts : 14
    Win7/8/10/Hackingtosh
    Thread Starter
       #13

    makes sense, but it is weird that the task Manager can still snipe the window fine...
      My Computer


  4. Posts : 3,257
    Windows 10 Pro
       #14

    Task Manager is probably looking further into the process than tasklist does (or taskkill)
      My Computer


  5. Posts : 93
    Windows 10
       #15

    Hi My1,

    Will this command work for you?
    Code:
    powershell "$shell = New-Object -ComObject WScript.Shell; $shell.AppActivate('Personalization'); $shell.SendKeys('%{F4}')"
      My Computer


  6. My1
    Posts : 14
    Win7/8/10/Hackingtosh
    Thread Starter
       #16

    takes some time but works.
      My Computer


  7. Posts : 93
    Windows 10
       #17

    Yes. Starting an instance of PowerShell can be really slow. The slowness is especially noticeable when executing such trivial tasks.


    If you're okay with using temp files, calling a VBScript from your batch script will be a much quicker solution than PowerShell.

    Code:
    @echo off
    
    
    REM Open a "Personalization" window 
    control /name Microsoft.Personalization
    
    
    REM One second minimum delay required
    timeout 2
    
    
    REM Close the "Personalization" window
    set temp_vbs="%TEMP%\%~nx0.tmp0.vbs"
    (
        echo Dim objShell
        echo Set objShell = CreateObject("WScript.Shell"^)
        echo If objShell.AppActivate("Personalization"^) = True Then
        echo    objShell.SendKeys("%%{F4}"^)
        echo End If
    ) > %temp_vbs%
    cscript %temp_vbs% //B
    del %temp_vbs%
    REM


    Also, My1, I'd like to know where you found taskkill /fi "WINDOWTITLE eq Personalization" on SevenForums? This command only works under very specific conditions. It won't work most of the time.
      My Computer


  8. My1
    Posts : 14
    Win7/8/10/Hackingtosh
    Thread Starter
       #18

    I have no problems with tempfiles.

    also I found it here when I wanted to google how to shut this window down in a script, post 3

    Is it possible to create a windows batch file to do this? - Windows 7 Help Forums

    btw this thing works epic, I have now completed my wanted script, which can save a lot of work when working with themes in W10 9926+.
      My Computer


  9. Posts : 93
    Windows 10
       #19

    In that SF thread, Duzzy's code suggestion to Neutron's script doesn't actually work there (always yielding the "INFO: No tasks running with the specified criteria." error). Not in Windows 7, not in Windows 10.


    My1 said:
    btw this thing works epic, I have now completed my wanted script, which can save a lot of work when working with themes in W10 9926+.
    Excellent news.
      My Computer


  10. My1
    Posts : 14
    Win7/8/10/Hackingtosh
    Thread Starter
       #20

    it did work for Mystere

    also you need admin in the cmd. so I added this little thing at the very beginning:

    Code:
    @echo off
    
    :: BatchGotAdmin
    :-------------------------------------
    REM  --> Check for permissions
    >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
    
    REM --> If error flag set, we do not have admin.
    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 "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
    
        "%temp%\getadmin.vbs"
        del "%temp%\getadmin.vbs"
        exit /B
    
    :gotAdmin
        pushd "%CD%"
        CD /D "%~dp0"
    :--------------------------------------
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:29.
Find Us




Windows 10 Forums