Windows Server - Cannot Log off after running 'Initial Program' for Remote Desktop

Asked By Brya
21-Sep-08 11:04 PM
We want to give a user access to a server via Remote Desktop and only give
them access to a single program.  This works perfectly fine, howerver when
the user (or us as Administrators) close the program, the program closes but
their is no way to exist out of the session unless you disconnect.  By no way
I mean the screen is just blue, looks like explorer.exe.
I have a Windows 2003 Server Environment.

Thank You
WshShell
(1)
CENTREL
(1)
CreateObject
(1)
YouHello
(1)
VBScript
(1)
Program
(1)
Application
(1)
Wscript
(1)
  homer replied...
25-Sep-08 05:00 AM
Hello,

Normally this should terminate and logoff the user as far as I am
aware. Perhaps the application is not completely terminating when you
quit?
Have you tried using a simple application like notepad to see when you
close this if the user is logged off? If this works then perhaps there
is an issue with the application.

Also something you may want to try is setting the user to run a vbs
file using the Inital Program of wscript {path to a vbs file} the
VBScript file then launches the application and waits for it to
finish, then runs the log off command. Lemme know if this helps.

wscript c:\launch.vbs

************* launch.vbs *************
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "c:\windows\notepad.exe", 1, True
WshShell.Run "c:\windows\system32\logoff.exe", 1, True
Set WshShell = Nothing



Thanks,


CENTREL Solutions, Automation and Management
http://www.centrel-solutions.com
Create New Account
help
escape and so on) to an application? Windows Server Scripting Discussions WScript (1) SendKeys (1) CreateObject (1) AppActivate (1) Wshshell (1) Application (1) Notepad (1) Schrieb (1) joe.user0@lycos.com schrieb: Something like this ? '- -- Set wshshell = CreateObject("WScript.Shell") wshshell.Run "notepad.exe" WScript.Sleep 1000 wshshell.SendKeys "Hello " & Chr(13) WScript.Sleep 1000 wshshell.SendKeys "Hello again " & Chr(13) WScript.Sleep 1000 wshshell.SendKeys "%{F4}" '- -- joe.user0@lycos.com schrieb: Something like this ? '- -- Set wshshell = CreateObject("WScript.Shell
have the following code on a login script to read the logon server name: Set WSHShell = CreateObject("Wscript.Shell") Set WSHProcess = WSHShell.Environment("Process") LogonServer = WSHProcess("LogonServer") But now I am not sure how to parse the data" End Any help will be appreciated - - Smoreno - ADOT Windows Server Scripting Discussions WSHProcess (1) WSHShell (1) CreateObject (1) LogonServer (1) Karmadanov (1) Smoreno (1) Servername (1) ABCDE (1) Should look like this have the following code on a login script to read the logon server name: Set WSHShell = CreateObject(Wscript.Shell) Set WSHProcess = WSHShell.En
following code to create a customized event log for my application Const NO_VALUE = Empty Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.RegWrite _ However, the only code I could find for writing to a specific log is Set WshShell = WScript.CreateObject("WScript.Shell") strCommand = "eventcreate / T Error / ID 100 / L Scripts / D " & _ Chr(34) & "Test event." & Chr(34) WshShell.Run strcommand My Problem is that every time an event is fired a command window this can be done ? All the best Frank Ball Windows Server Scripting Discussions WScript (1) WshShell (1) CreateObject (1) StrCommand (1) EventLog (1) EVENT_SUCCESS (1) CurrentControlSet (1) TechNet (1) WshShell.Run strcommand, 0
startup script (adminpass.vbe) to change the local admin passwords on our PC's. - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - Set WshShell = WScript.CreateObject("WScript.Shell") WSHShell.Run "Net User administrator password Set WSHShell = Nothing - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - I have created a group policy and link enabled it to a non-production but to no avail. Windows 2000 Active Directory Discussions OpenAsASCII (1) Scripting.FileSystemObject (1) WScript.CreateObject (1) ObjFSO.OpenTextFile (1) ObjFSO.FileExists (1) WScript.Shell (1) CreateIfNotExist (1) Wscript.Network (1) I would use code similar to: = = = = = = = = = = = = = = = Option Explicit Dim wshShell, intError Set wshShell = CreateObject("Wscript.Shell") intError = wshShell.Run("%comspec% / c net user administrator password", 2, True) = = = = = = = = = = I use