Windows 8 and 8.1 Forums

Creating bat File

  1. #1

    Creating bat File


    Hello users!

    I am using the following code in a .bat file to end remote desktop connection upon running the file:

    Code:
    @%windir%\System32\tscon.exe 0 /dest:console
    @%windir%\System32\tscon.exe 1 /dest:console 
    @%windir%\System32\tscon.exe 2 /dest:console 
    @%windir%\System32\tscon.exe 2 /dest:console 
    @%windir%\System32\tscon.exe 3 /dest:console 
    @%windir%\System32\tscon.exe 4 /dest:console 
    @%windir%\System32\tscon.exe 5 /dest:console
    However when I run this, the server computer comes up with an error saying that remote desktop connection was interupted. How can I cut the session off without getting the error message?

      My System SpecsSystem Spec

  2. #2


    Posts : 1
    Windows 8


    I use this as well, but when running on a Windows 8 PC, I get an error about ACCESS IS DENIED.

    Is there a solution ??

    Works fine on Windows 7 PCs.

    EDIT: Just realised that running the .bat file via "Run as Administrator" works.

    Is there a way to run via my own account, which is in Administrator group.
      My System SpecsSystem Spec

  3. #3


    Posts : 959
    Windows 8.1, 10


    I know nothing about remote desktop connections... but I am curious as to why there are two seemingly identical rows with parameter 2. Is there something about "2" that needs to be done twice?
      My System SpecsSystem Spec

Creating bat File
Related Threads
creating a boot up dvd in General Support
new laptop during set up was not asked to create a boot up dvd, had a hunt around the control panel and the internet. Just cannot remember how to do it, can some one remind me please. w8.1 pre installed no disc supplied.
I need a way to play a video constantly all day, I found the following batch file which when edited for my video works perfectly in both Chrome and Firefox but does not work in Internet explorer(IE) Does any one have a solution for IE please. The Batch file is as follows:- <!DOCTYPE html> <html>...
Hi, I want to create a new file extension named ".emsof" and associate any text editor with it like notepad++ in windows 8.1 Moreover all of these files should be searched by having filter of "*.emsof" like any other ordinary files. Please guide me about how to do it? Thanks.
Hi, I want to create a new file extension named ".emsof" and associate any text editor with it like notepad++ in windows 8.1 Moreover all of these files should be searched by having filter of "*.emsof" like any other ordinary files. Please guide me about how to do it? Thanks.
Solved creating scripts in General Support
how can you create a script to open cmd and run 'ipconfig /flushdns' at the click of a button?
So the idea is. i want to have an icon(shortcut) on my start screen that opens a rom file with the emulator with just one click. Is that possible? This way I could have every single game(rom) on the start screen to choose from instead of going to desktop, open the emulator and select(search ) the...
Eight Forums Android App Eight Forums IOS App Follow us on Facebook