Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

logoff script wscript.exe

Featured Replies

Hi All,

I need some assistance once again;

I have a script which enables me to logoff of rdp via xp and also logs off the os. I tried using on win2k but to no avail!!

Set objExec = objShell.Exec("logoff") <-- I use this and it works great on XP but not on windows 2000, does anybody know the proper command or wording.

Thanks

Try this...


Set objSys = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * From Win32_OperatingSystem")

For Each v In objSys
v.Win32Shutdown(0) ' Or Win32Shutdown(4) to force logoff
Next

  • Author

jdoe Thanks,

Now for the really stupid question on my behalf. How can I put it together below;

' vmconnect.vbs - Connect to a user's Virtual Machine instead of explorer.exe as the shell.

Dim objShell, objExec, strAppExe

strAppExe="mstsc.exe %logonserver%\netlogon\vmware\VM-W2K\vmw-%username%.rdp"

Set objShell = CreateObject("WScript.Shell")

Set objExec = objShell.Exec(strAppExe)

Do While objExec.Status = 0

WScript.Sleep 500

Loop

Set objExec = objShell.Exec("logoff")

Above is the code for Windows XP, how can I incoporate the code below??

Set objSys = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * From Win32_OperatingSystem")For Each v In objSys    v.Win32Shutdown(0)    ' Or Win32Shutdown(4) to force logoffNext

Thanks for the help.

It should looks like this...



Set objShell = CreateObject("WScript.Shell")
Set objSys = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * From Win32_OperatingSystem")

strAppExe="mstsc.exe %logonserver%\netlogon\vmware\VM-W2K\vmw-%username%.rdp"

objShell.Run strAppExe, , True

For Each v In objSys
v.Win32Shutdown(0) ' Or Win32Shutdown(4) to force logoff
Next

I'm not sure about the use of %logonserver% and %username%. Did you really make it work once ?

  • Author

jdoe,

Thanks I will try that and let you know,

%logonserver% and %username% yeah that does work...

I will let u know..

Thanks

<Edit>

jdoe,

Works like a charm...

Thanks a whole lotsssss

</Edit>

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.