Windows 10: closing personalization window in CMD

Discus and support closing personalization window in CMD in Windows 10 Support to solve the problem; Task Manager is probably looking further into the process than tasklist does (or taskkill) Discussion in 'Windows 10 Support' started by My1, Mar 1, 2015.

  1. Mystere Win User

    closing personalization window in CMD


    Task Manager is probably looking further into the process than tasklist does (or taskkill)
     
    Mystere, Mar 1, 2015
    #16
  2. Pyprohly Win User

    Hi My1,

    Will this command work for you?
    Code: powershell "$shell = New-Object -ComObject WScript.Shell; $shell.AppActivate('Personalization'); $shell.SendKeys('%{F4}')"[/quote]
     
    Pyprohly, Mar 4, 2015
    #17
  3. MY1
    My1 Win User
    takes some time but works.
     
  4. Pyprohly Win User

    closing personalization window in CMD

    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[/quote]

    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.
     
    Pyprohly, Mar 4, 2015
    #19
  5. MY1
    My1 Win User
  6. Pyprohly Win User
    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.


    Excellent news.
     
    Pyprohly, Mar 4, 2015
    #21
  7. MY1
    My1 Win User
    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" :--------------------------------------[/quote]
     
  8. Pyprohly Win User

    closing personalization window in CMD

    Strange. It doesn't work for me. I hope Mystere will jump on here and explain how he opened the Personalization window. How this window is opened is important for the mentioned Taskkill command to work.


    And here's the PowerShell alternate: shorter, cleaner and no temp files needed. However, the same drawback of speed applies.
    Code: net session >NUL 2>&1|| powershell Start-Process '%0' -Verb RunAs&& exit /b|| exit /b[/quote]
     
    Pyprohly, Mar 4, 2015
    #23
  9. MY1
    My1 Win User
    well I dont want to wait that long, it maybe shorter, but a temp file that is deleted roughly 2 sec after exec is sth. I dont care about...

    if they could speed up Powershell it would be nice tho...
     
  10. Mystere Win User
    I opened it by right clicking on the desktop and choosing Personalize. Then Opened a command prompt elevated and typed the taskkill command, which worked perfectly.
     
    Mystere, Mar 4, 2015
    #25
  11. Pyprohly Win User
    Agreed: speed up the PowerShell initialization time. PowerShell is fast. It's its environment which takes time to setup that is the cause for all the slowness.

    What would be nice would be to see some way of being able trigger VBScript script directly within batch files; without the need of external temp files.


    I'm puzzled. I tested the same procedure on both Windows Professional x64 and Windows Ultimate x86, and both raise the "INFO: No tasks running with the specified criteria." error.

    Oh well. Best not to think too hard about it... *Huh
     
    Pyprohly, Mar 5, 2015
    #26
  12. MY1
    My1 Win User
    true I mean we have woking ways both short/clean and fast (I prefer the latter one, I mean the temp file does get deleted afaik)
     
Thema:

closing personalization window in CMD

Loading...
  1. closing personalization window in CMD - Similar Threads - closing personalization window

  2. CMD and PowerShell Closing after a couple of seconds, CMD and Powershell closing.

    in Windows 10 Gaming
    CMD and PowerShell Closing after a couple of seconds, CMD and Powershell closing.: My Laptop is fine i didnt download any viruses, Didnt mess with system files nor modify it. After a normal restart, A message that pops up for half a second saying "This app wont work on this computer" Or something like that The messages appears and disappears too fast its...
  3. CMD and PowerShell Closing after a couple of seconds, CMD and Powershell closing.

    in Windows 10 Software and Apps
    CMD and PowerShell Closing after a couple of seconds, CMD and Powershell closing.: My Laptop is fine i didnt download any viruses, Didnt mess with system files nor modify it. After a normal restart, A message that pops up for half a second saying "This app wont work on this computer" Or something like that The messages appears and disappears too fast its...
  4. CMD and PowerShell Closing after a couple of seconds, CMD and Powershell closing.

    in Windows 10 Customization
    CMD and PowerShell Closing after a couple of seconds, CMD and Powershell closing.: My Laptop is fine i didnt download any viruses, Didnt mess with system files nor modify it. After a normal restart, A message that pops up for half a second saying "This app wont work on this computer" Or something like that The messages appears and disappears too fast its...
  5. Windows CMD opened application using START - application closes when CMD window closes.

    in Windows 10 Software and Apps
    Windows CMD opened application using START - application closes when CMD window closes.: In my environment I cannot do anything until I'm connected to my company's VPN. So, there are several apps that I don't want to start until I'm connected: Outlook, OneDrive and Teams. I created a simple BAT file that I execute after I am connected. I've been using this for...
  6. Windows CMD opened application using START - application closes when CMD window closes.

    in Windows 10 Network and Sharing
    Windows CMD opened application using START - application closes when CMD window closes.: In my environment I cannot do anything until I'm connected to my company's VPN. So, there are several apps that I don't want to start until I'm connected: Outlook, OneDrive and Teams. I created a simple BAT file that I execute after I am connected. I've been using this for...
  7. Windows CMD opened application using START - application closes when CMD window closes.

    in Windows 10 Gaming
    Windows CMD opened application using START - application closes when CMD window closes.: In my environment I cannot do anything until I'm connected to my company's VPN. So, there are several apps that I don't want to start until I'm connected: Outlook, OneDrive and Teams. I created a simple BAT file that I execute after I am connected. I've been using this for...
  8. CMD And PowerShell Open And Close

    in Windows 10 Gaming
    CMD And PowerShell Open And Close: I was playing a game and out of nowhere my game tabbed out and cmd flashed open and closed immediately and seconds later PowerShell did the same thing. I thought nothing of it so I kept playing and then it kept happening after every game. I haven't updated anything and i...
  9. cmd closes with right click

    in Windows 10 BSOD Crashes and Debugging
    cmd closes with right click: When I press right click on the mouse the cmd window closes. This is on Windows 10 Professional 64 bit. Any ideea? https://answers.microsoft.com/en-us/windows/forum/all/cmd-closes-with-right-click/a928ea83-1b56-4211-b9ed-44b26efbc611
  10. CMD window closing as soon as opened

    in Windows 10 Support
    CMD window closing as soon as opened: This just started about two weeks ago. As soon as use the CMD command the window closes right away. Doing some research, I think possibly it occurred after my computer got infected with a miner. My antivirus killed it right away and dozens of full scans indicate I am virus...

Users found this page by searching for:

  1. widow 7 closing personalization window with bat file

    ,
  2. batch file to close personalization window