locked
Remote Desktop Bat File Help RRS feed

  • Question

  • I am not sure this is the right forum but here it goes. Currently i changed the user interface  from explorer.exe to mstsc.exe. I want the desktop to only show remote desktop when users log in. The problem i am facing is that when users log of of the remote desktop it is just a blank screen.

     

    I have a vb script that dosnt seem to run on this machine for some reason. But it runs on every other windows 7 client:  Batch files seem to work. I need help coming up with a batch file that checks if the proces mstsc is running if it is then do nothing but if it isnt then i want it to lauch mstsc.

     

    Is this possible to create a batch job that loops? If you have any questions please let me know. I would appreciate any help you could give me.

    Thursday, November 10, 2011 2:45 PM

Answers

  • Hi,

     

    “tasklist /FI "IMAGENAME eq mstsc.exe" | qgrep mstsc.exe

    if ERRORLEVEL 1 (start mstsc.exe) ELSE (goto:EOF)”

     

    I have a method to achieve your purpose. You could create a task in Task Scheduler”

     

    a.       Create a task in Task Scheduler. Since the file will be executed every startup, set the Trigger to be “On idle”. Then chose the idle time:

    b.      On the Action tab, choose "Start a program" and select the file.

    c.       Press OK to create the task

     

    Hope that helps


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
    • Marked as answer by Arthur Xie Friday, December 9, 2011 2:50 AM
    Thursday, November 17, 2011 2:59 AM

All replies

  • I got the below working. How do i make this loop?


    tasklist /FI "IMAGENAME eq mstsc.exe" | qgrep mstsc.exe
    if ERRORLEVEL 1 (start mstsc.exe) ELSE (goto:EOF)

    Thursday, November 10, 2011 4:21 PM
  • Hi,

     

    “tasklist /FI "IMAGENAME eq mstsc.exe" | qgrep mstsc.exe

    if ERRORLEVEL 1 (start mstsc.exe) ELSE (goto:EOF)”

     

    I have a method to achieve your purpose. You could create a task in Task Scheduler”

     

    a.       Create a task in Task Scheduler. Since the file will be executed every startup, set the Trigger to be “On idle”. Then chose the idle time:

    b.      On the Action tab, choose "Start a program" and select the file.

    c.       Press OK to create the task

     

    Hope that helps


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
    • Marked as answer by Arthur Xie Friday, December 9, 2011 2:50 AM
    Thursday, November 17, 2011 2:59 AM