Win ERROR when I run "C:\Windows\System32\tsdiscon.exe" from XBMC
#1
"C:\Windows\System32\tsdiscon.exe"
I want to run this command from the main menu. I already have the skin modded to do this, the problem is that when I click on the menu item and run it i get an error saying windows can't find it. This makes no sense at all to me since I can run the exact same command from a console windows (cmd.exe) and it runs find. I can run it from a batch and it runs fine. the problem seems to have to do with XBMC.

The reason I want to do this is because I run XBMC as the shell for one of my user accounts on the computer and I want a way to easily switch users. tsdiscon.exe disconnects the session which leaves the user log in but send you back to the switch user screen.

I have tried the following
Code:
<onclick>System.Exec(""C:\Windows\System32\tsdiscon.exe"")</onclick>
<onclick>System.Exec("C:\Windows\System32\tsdiscon.exe")</onclick>
<onclick>System.Exec(""D:\Program Files\tsdiscon.bat"")</onclick>

tsdiscon.bat contains
Code:
START "Switch User" "C:\Windows\System32\tsdiscon.exe"
Reply
#2
*Bump*
Reply
#3
How about:
Code:
<onclick>System.Exec(C:\Windows\System32\tsdiscon.exe)</onclick>
Reply
#4
Try escaping the backspaces in the path with a backspace i.e.
Code:
C:\\Windows\\System32\\tsdiscon.exe
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#5
Thanks guys, I tried both of your suggestions but they didn't work. I finally figured it out. It must have been a permission problem. I tried lunching notepad which is in the same directory and that worked fine. So then I gave read & execute permission to the user account for XBMC on tsdiscon.exe and it worked. I do most of my testing in a different user account, when I tested it in the XBMC account I must have already been elevated, so it worked form the console, but not XBMC.
Reply
#6
xbmc is not going to pick up the back slash when specifying a directory, use the foward slash instead of

<onclick>System.Exec(""D:\Program Files\tsdiscon.bat"")</onclick>
use
<onclick>System.Exec(""D:/Program Files/tsdiscon.bat"")</onclick>
worked for me
Reply
#7
Incase anyone lands here looking for a solution, I got mine working like this

Code:
<onclick>AlarmClock(exit,RunScript(special://skin/system/LogOut.py),00:3,silent,)</onclick>


logout.py

Code:
import ctypes
ctypes.windll.user32.LockWorkStation()

Hope this helps!
Reply

Logout Mark Read Team Forum Stats Members Help
ERROR when I run "C:\Windows\System32\tsdiscon.exe" from XBMC0