[THIN] Re: OT: VBScript assistance needed
- From: "Jeremy Saunders" <Jeremy.Saunders@xxxxxxxxxxxxxx>
- To: <thin@xxxxxxxxxxxxx>
- Date: Tue, 28 Apr 2009 18:59:19 +1000
I've not tested this...just put it together in Notepad, but why don't
you just use the Run method to execute logoff.exe?
Option Explicit
Dim objshell
Set objshell = WScript.CreateObject ("WScript.Shell")
objShell.Run "cmd.exe /c logoff.exe"
Set objshell = Nothing
wscript.quit(0)
Cheers,
Jeremy.
From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On
Behalf Of Andrew Wood
Sent: Tuesday, April 28, 2009 4:34 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: OT: VBScript assistance needed
Is this a pure TS environment? If you've Ctx you could use MFCOM you
could do :-
For each asession in oMFServer.Sessions
Assession.logoff(false)
Next
Where oMFServer is an metaframecom.metaframeserver object for the
current machine
Failing that you could always enumerate the sessions and run a logoff
command for each one.
From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] On
Behalf Of Steve Snyder
Sent: 28 April 2009 02:13
To: thin@xxxxxxxxxxxxx
Subject: [THIN] OT: VBScript assistance needed
trying to implement a logoff in vbscript, a la
set objOS -
getobject("winmgmts:{(Shutdown)}//.root/cimv2").execquery("select * from
win32_operatingsystem where primary=true")
for each objsys in objOS
objsys.win32shutdown 0
next
which works great on a 32bit windows system, not so great on a 64bit
windows system. Any ideas how to make this fly on 64bit?
#####################################################################################
Confidentiality and Privilege Notice
This document is intended solely for the named addressee. The information
contained in the pages is confidential and contains legally privileged
information. If you are not the addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone, and you should destroy this message and kindly
notify the sender by reply email. Confidentiality and legal privilege are not
waived or lost by reason of mistaken delivery to you.
#####################################################################################
Other related posts: