Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


CTRL+ALT+DEL with VBS?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1796
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> CTRL+ALT+DEL with VBS?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 CTRL+ALT+DEL with VBS? - 1/6/2005 7:20:00 AM   
  ZenKenobi

 

Posts: 10
Score: 0
Joined: 8/3/2004
From: USA
Status: offline
Is it possible to use Shell.SendKeys to press ctrl+alt+del simultaneously? I need to write a script that will automatically log me into my windows system at a specific time. The only problem is pressing these three buttons at the same time. Can anyone help?

_____________________________

Erik Gardner
 
 
Post #: 1
 
 Re: CTRL+ALT+DEL with VBS? - 1/6/2005 7:34:06 AM   
  tnoonan

 

Posts: 364
Score: 0
Joined: 12/14/2004
From:
Status: offline
wshshell.Sendkeys("%^+{DEL}")

(in reply to ZenKenobi)
 
 
Post #: 2
 
 Re: CTRL+ALT+DEL with VBS? - 1/6/2005 7:43:31 AM   
  tnoonan

 

Posts: 364
Score: 0
Joined: 12/14/2004
From:
Status: offline
Ops sorry thats for my vncviewer.

(in reply to ZenKenobi)
 
 
Post #: 3
 
 Re: CTRL+ALT+DEL with VBS? - 1/6/2005 11:47:54 PM   
  drbelden

 

Posts: 109
Score: 0
Joined: 12/21/2004
From: USA
Status: offline
Maybe someone has a solution out there, but the scripting guys at Microsoft don't seem to think it's possible.

http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov04/hey1115.mspx

This article is about locking a workstation, but they also talk about your issue later in the article.

(in reply to ZenKenobi)
 
 
Post #: 4
 
 Re: CTRL+ALT+DEL with VBS? - 1/7/2005 1:03:27 AM   
  Zifter


Posts: 318
Score: 0
Joined: 1/5/2005
From: Belgium
Status: offline
Almost at the bottom of this page http://www.devguru.com/Technologies/wsh/quickref/wshshell_SendKeys.html they give an example how to use SendKeys to produce CTRL-ALT-DELETE keystroke.

But when I try it, it doesn't work...

(in reply to ZenKenobi)
 
 
Post #: 5
 
 Re: CTRL+ALT+DEL with VBS? - 1/7/2005 1:59:05 AM   
  tnoonan

 

Posts: 364
Score: 0
Joined: 12/14/2004
From:
Status: offline
Its only going to work for vnc, or win95 all other operating systems will not allow a sendkey for cntrl-alt-delete. As posted above. I use a script that launches vnc to the pc I want that logs into vnc and sends cntrl-alt-delete and then logs in with my account.

(in reply to ZenKenobi)
 
 
Post #: 6
 
 Re: CTRL+ALT+DEL with VBS? - 1/7/2005 3:42:54 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
it is a Win2k security that only users behind the keyboard (physical) are allowed to do the combination of Ctrl Alt Delete.

MCSE talks about this!


(in reply to ZenKenobi)
 
 
Post #: 7
 
 Re: CTRL+ALT+DEL with VBS? - 1/7/2005 4:34:01 AM   
  tnoonan

 

Posts: 364
Score: 0
Joined: 12/14/2004
From:
Status: offline
sending a cntrl-alt-del with vnc, weather tightvnc or realvnc, is built into the software and works on all os's.

(in reply to ZenKenobi)
 
 
Post #: 8
 
 Re: CTRL+ALT+DEL with VBS? - 1/7/2005 4:48:08 AM   
  tnoonan

 

Posts: 364
Score: 0
Joined: 12/14/2004
From:
Status: offline
I also use it in my find user script

Option Explicit

const COMMAND_EXEC = "NETSH WINS SERVER \\10.0.3.18 show name "
const COMMAND_VNC = "C:\Program Files\RealVNC\vncviewer.exe "
'const COMMAND_VNC = "C:\Program Files\ORL\VNC\vncviewer.exe "

Dim objWshShell , objExec, strUserName, strOutput, intLine, oshell
Dim intPosition, strIP, arrEntrySplit, strComputerName, intRemote

strUserName = InputBox("Please enter a user name:" & vbCRLF & vbCRLF & _
"(Press [ENTER] or click [CANCEL] to exit...)", _
"Spoogenet", "")

Do While strUserName <> ""
Set objWshShell = CreateObject("WScript.Shell")
Set objExec = objWshShell.Exec (COMMAND_EXEC & strUserName & " 03")
For intLine = 1 To 4
objExec.StdOut.ReadLine
Next
If objExec.StdOut.ReadLine <> "The name does not exist in the WINS database." Then
For intLine = 1 To 5
objExec.StdOut.ReadLine
Next
strOutput = objExec.StdOut.ReadLine
If Left(strOutput,10) <> "IP Address" Then
strOutput = objExec.StdOut.ReadLine
End If
intPosition = InStr(strOutput, ":")
strIP = Right(strOutput, (Len(strOutput) - intPosition))
Set objExec = objWshShell.Exec("NBTSTAT -A " & strIP)
Do While Not objExec.StdOut.AtEndOfStream
strOutput = objExec.StdOut.ReadLine
If InStr(strOutput,"<03>") <> 0 Then
arrEntrySplit = Split(strOutput)
If UCase(arrEntrySplit(4)) <> UCase(strUserName) And _
UCase(arrEntrySplit(4)) <> UCase(strComputerName) And _
UCase(arrEntrySplit(4)) <> strComputerName & "$" Then
strComputerName = strComputerName & UCase(arrEntrySplit(4))
End If
End If
Loop
If strComputerName <> "" Then
MsgBox "The requested user '" & strUserName & _
"' is logged on to: " & strComputerName,,"User Computer Name Locator"
Else
MsgBox "The requested user '" & strUserName & _
"' doesn't appear to logged on to the network. "
End If
Else
MsgBox "The user was not found in the WINS database. ",, _
"User Computer Name Locator"
End If
Set objExec = Nothing
Set objExec = objWshShell.Exec (COMMAND_VNC & strComputerName)
WScript.Sleep 1000
objwshshell.Sendkeys("password")
WScript.Sleep 1000
objwshshell.SendKeys("{ENTER}")
WScript.Sleep 1000

'Send ctrl + alt + del to vncviewer
objwshshell.Sendkeys("%^+{DEL}")
Set objExec = Nothing
strComputerName = ""
strUserName = InputBox("Please enter a user name:" & vbCRLF & vbCRLF & _
"(Press [ENTER] or click [CANCEL] to exit...)", _
"User Computer Name Locator", "")
Loop

(in reply to ZenKenobi)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> CTRL+ALT+DEL with VBS? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts