Windows 10: Can we execute a batch file when we switch virtual desktops?

Discus and support Can we execute a batch file when we switch virtual desktops? in Windows 10 Customization to solve the problem; If we can't do this now: In the following text, when the word batch is used but makes less sense than the word script, mentally replace the word... Discussion in 'Windows 10 Customization' started by JamesATyler, Jan 6, 2021.

  1. Can we execute a batch file when we switch virtual desktops?


    If we can't do this now:


    In the following text, when the word batch is used but makes less sense than the word script, mentally replace the word batch with the word script


    Can Microsoft create a program that executes a batch file whenever a new virtual desktop is chosen? So that, when I switch desktops, that batch file will run automatically or manually depending on a setting if I have typed a batch filename into the appropriate spot and the batch file exists in the appropriate directory.

    That will allow me to put into a batch file a program which loads a different desktop configuration file if such a program can be created. I can also put into the batch file any other computer operations I want to be done when I choose a different desktop. Such as opening or closing files/anything that can be done from a batch file

    Would Microsoft allow me to setup the batch file to be executed by switching to the task view, right clicking on a virtual desktop to open a context menu, selecting an option called something like "choose a batch file to execute when this desktop is selected" and allow me to choose the batch file with the file picker? Could it also be allowed for me to checkmark an option to have the batch file run automatically when I select the batch file.

    Not to mention, that it would be nice if I can also manually execute the batch file associated with the current desktop without switching desktops, even if that means I first have to switch to task view and use the context menu on the virtual desktop.


    Also,

    Can Microsoft create a program that will swap the current windows desktop configuration files for another pre-made ones? Configuration of shortcuts/icons/folders/wallpaper/and anything else configurable And also allow us to save a current configuration as a file?

    :)
     
    JamesATyler, Jan 6, 2021
    #1

  2. Batch file

    thank you for your reply. how to merge the codes so that the batch file does this

    the batch file displays the options below

    1. open the *.spl file in notepad
    2. delete the *.shd and *.spl files
    3.exit

    commands execute as options are selected
     
    Sandeep Bhugoo, Jan 6, 2021
    #2
  3. F.Wu Win User
    Unable to execute all commands in batch file

    Hi,

    I have a problem to execute batch file. There is an app running and monitoring UPS signal. If that signal goes true, the app will launch a batch file to close itself and then shutdown the PC after 30 seconds.

    the content of the batch file is like this:

    @Echo off

    app.exe -exit

    pause 30

    shutdown.exe /s /t 5

    However, it seems the system only executed the first two lines of commands
    app.exe, it closed the app, and did not shutdown the PC. If I run the batch file itself by double clicking the batch file, all commands are executed and PC shutdown properly.

    What is the problem and how to fix it? Thanks
     
    F.Wu, Jan 6, 2021
    #3
  4. Flava0ne Win User

    Can we execute a batch file when we switch virtual desktops?

    Creating Shortcuts with Batch File

    Tried both of the VB Scripts that you provided and adding the 9 switch to the batch file but neither was able to create a shortcut to my desktop.
     
    Flava0ne, Jan 6, 2021
    #4
Thema:

Can we execute a batch file when we switch virtual desktops?

Loading...
  1. Can we execute a batch file when we switch virtual desktops? - Similar Threads - execute batch file

  2. Taskbar Disappear When Switching Virtual Desktop

    in Windows 10 Gaming
    Taskbar Disappear When Switching Virtual Desktop: Hi,I'm encountering a bug where no one seems to be talking about.When switching between virtual desktops, taskbar and its blur background is not retained on the new desktop so the area appears as empty when switching, and taskbar suddenly appears after fully switched to the...
  3. Taskbar Disappear When Switching Virtual Desktop

    in Windows 10 Software and Apps
    Taskbar Disappear When Switching Virtual Desktop: Hi,I'm encountering a bug where no one seems to be talking about.When switching between virtual desktops, taskbar and its blur background is not retained on the new desktop so the area appears as empty when switching, and taskbar suddenly appears after fully switched to the...
  4. When will we get virtual desktop transition animation finally fixed?

    in Windows 10 Gaming
    When will we get virtual desktop transition animation finally fixed?: I have been waiting for over a year for this. MS Windows has been making a lot of updates that no one really asked for or needs. Please may we get the virtual desktop animations we've been asking for, for over a year. It's extremely hard navigating virtual desktops without...
  5. When will we get virtual desktop transition animation finally fixed?

    in Windows 10 Software and Apps
    When will we get virtual desktop transition animation finally fixed?: I have been waiting for over a year for this. MS Windows has been making a lot of updates that no one really asked for or needs. Please may we get the virtual desktop animations we've been asking for, for over a year. It's extremely hard navigating virtual desktops without...
  6. Can we stop this?

    in Windows 10 Gaming
    Can we stop this?: I was trying to download Brave and after like 9 seconds, it showed Family Safety. I JUST WANT A NEW BROWSER MICROSOFT EDGE ISN'T ENOUGH! Can we stop it so i can get Brave?How much of Microsoft EdgeHow much of Brave50%100%Brave Download: Brave - Download softonic.com <----...
  7. Why we scan with antivirus if we can only just upload the file to virustotal but we can...

    in Windows 10 Installation and Upgrade
    Why we scan with antivirus if we can only just upload the file to virustotal but we can...: Why we scan with antivirus if we can only just upload the file to virustotal but we can upload only 20mb files or something https://answers.microsoft.com/en-us/windows/forum/all/why-we-scan-with-antivirus-if-we-can-only-just/6ccce918-7ab8-43f9-85e5-62413c55fb58
  8. Virtual desktop switch

    in Windows 10 Ask Insider
    Virtual desktop switch: Windows 10, laptop. Sometimes when I log onto my PC, the virtual desktop switches to the furthest on the right. I haven't seen anyone having the same problem, and it's bothering me. submitted by /u/grzesiu447 [link] [comments]...
  9. Virtual desktop switch

    in Windows 10 Virtualization
    Virtual desktop switch: win+tab opens virtual desktop switch ... but by repeated press it again disappears instead of continuing to next desktop :/ do you know how to advance to next desktop ? by keyboard not by pointing cursor over 2nd desktop ??? (win+tab+1 .... did not worked) alt+tab -...
  10. do we still have %~ in batch files in windows 10

    in Windows 10 Support
    do we still have %~ in batch files in windows 10: Greetings I still write batch files like I always did since dos. In windows XP all kinds of %~ variables were added to the vocabulary. Do we still have those or were they replaced by other in windows 10? where do I find a list of batch file commands still used in windows...