473,503 Members | 241 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programatically bypass CTRL + Alt + Del on restart?

5 New Member
hi,

when i ask my program to restart the PC by Code ((Shell "Shutdown -r -f -t 0"))

it's open again up to the login windows

I need the code which allow me to send the ctrl+alt+Del to open the windows to complete my instantiation and running the program

can anyone help me.

thanks
Sep 3 '07 #1
12 5363
Killer42
8,435 Recognized Expert Expert
I think the whole reason MS used the Ctrl-Alt-Del sequence at startup was to prevent programs from doing that without user intervention. Or to put it another way, I don't think you can.

I could be wrong, of course.
Sep 4 '07 #2
pureenhanoi
175 New Member
hi,

when i ask my program to restart the PC by Code ((Shell "Shutdown -r -f -t 0"))

it's open again up to the login windows

I need the code which allow me to send the ctrl+alt+Del to open the windows to complete my instantiation and running the program

can anyone help me.

thanks
You can restart windows by code without sending "Ctrl+Alt+Del" combination key.

Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Boolean
Public Const EWX_SHUTDOWN = 1
Public Const EWX_REBOOT = 2
Public Const EWX_LOGOFF = 0

To restart window:
Dim ret As Boolean
ret = ExitWindowsEx(EWX_REBOOT,0)
Sep 4 '07 #3
Killer42
8,435 Recognized Expert Expert
You can restart windows by code ...
Are you saying this will make Windows restart and log on again automatically, without user input?
Sep 4 '07 #4
mfibrik
5 New Member
Are you saying this will make Windows restart and log on again automatically, without user input?

Thanks for all of u

I mean really that reopen the windows automatic after I send the parameters with the User and Password,

As if you open the computer from Symantec pcAnywhere or Logmein.
I rather if you can visit www.Logmein.com to know what I am looking for

ex. I need code to let me open the windows from the user and password as when u press Ctrl+ alt+ del when you login (with domain ) not a sample user

best wishes
Sep 4 '07 #5
Martin2007
21 New Member
I mean really that reopen the windows automatic ...
Surely any program you have running will be killed when you restart the pc...? So your code won't be running even if you could send ctrl-alt-del?
Sep 5 '07 #6
pureenhanoi
175 New Member
Are you saying this will make Windows restart and log on again automatically, without user input?
There is no way to logon automatically after restarting Windows. After restarting, Windows need user input Username and password to complete logon. If your computer has only one active user (except Administrator and Guest - thats often disabled), and this user has not password protected, the windows will automatically logon to this account. But if the windows has more User, it cant be logged on untill has user input.
If you want keep program still running, there is one complexibility technique that store all ram memory into hard disk. The next time windows logged on, you must manually copy data from harddisk into ram memory, so the program continue running. ( This is complexibility technique, so there is no more people can do that.)
If you just want open again your program after restarting windows (do not keep its running status), so the Setup program must store a Key in to Registry (at: HKLM\Software\Microsoft\Windows\CurrentVersion\Run ). This key has type of String, and its value must be the full path to Executeable file (you maybe want it point to your program). If you want your program continue running at startup, so do nothing, otherwise, remove this key at the first running of application.
Note: with this method, your program just be opened after the windows logged on and it runs in the starting point ( cannot keep running status ).
Dont try logon to windows without user input. Microsoft will not give you permission.
Sep 6 '07 #7
Killer42
8,435 Recognized Expert Expert
There is no way to logon automatically after restarting Windows. ...
That was my point. The OP was asking how to bypass the manual logon process. I didn't think you could.
Sep 6 '07 #8
Killer42
8,435 Recognized Expert Expert
... Dont try logon to windows without user input. Microsoft will not give you permission.
Yeah. Even when Windows Update installs an update and reboots, you have to go through the usual logon process. If MS won't even let themselves do it...
Sep 6 '07 #9
pureenhanoi
175 New Member
Yeah. Even when Windows Update installs an update and reboots, you have to go through the usual logon process. If MS won't even let themselves do it...
Of course they can do. But they don't do that. Windows Update often takes a long time to download and install into machine. Imagine that, you let Windows automatically download and install the update, meanwhile, you go out for a cup of coffee. When you come back, the update process has completed and Windows automatically logged on. There may be many users who can use your computer and do things that are harmful to your computer.
Of course, hackers can use some techniques to logon to the computer without knowing your password. But that's Microsoft's security. Windows is their product and they know how to log on without user input.
You were wrong if you said that: "MS won't event let themselves do it"
Sep 6 '07 #10
chrisfry
6 New Member
when i ask my program to restart the PC by Code ((Shell "Shutdown -r -f -t 0"))

it's open again up to the login windows

I need the code which allow me to send the ctrl+alt+Del to open the windows to complete my instantiation and running the program
Hi mfibrik,

This isn't an exact answer to what you've asked. As others have mentioned, being able to bypass Ctrl+Alt+Del without action from a person would be a security flaw. Am I right however, in assuming that what you're really trying to do is get a program to start up automatically when you restart a computer?

That can be done in a number of ways.

1. Create a windows service to start the app. You could use a method like the one described here, which lets you create custom services for applications: http://www.tacktech.com/display.cfm?ttid=197

2. Configure an account to log in automatically, then write a script (Windows logon or startup) to start the program then lock your computer so it isn't sitting there logged in.

For autologon there are two methods here:
http://windowsxp.mvps.org/Autologon.htm

The first one worked fine for me when I tested it. I made an account called AutoLogon to test it with first:
Click Start, Run and type CONTROL USERPASSWORDS2, and click Ok. Select the user account from the list (the account to which you want to automatically logon). Uncheck Users must enter a user name and password to use this computer option, and click Ok. Type the user account password and complete the process.
You can always log off the account and log into another, once you've set this up. Also, you can hold Shift while Windows is loading to cancel the autologon.

Here's an example script that starts Notepad (replace with the path to your application), then locks your computer. Copy this into a text file, save it as something like loadAppAndLock.vbs, then put a shortcut to it in the Startup folder for the account that will log on automatically. Alternatively, you could just put a shortcut to your application in the Startup folder too and ommit lines 10, 11, 15 and 16.

Expand|Select|Wrap|Line Numbers
  1. ' loadAppAndLock.vbs
  2.  
  3. ' Opens APPLICATION_NAME then locks the workstation.
  4. ' Author: Chris Fry, Canberra, Australia
  5. ' 25th October, 2007
  6. ' -----------------------------------------------------'
  7. On Error Resume Next
  8.  
  9. 'Change this to your application path
  10. CONST APPLICATION_NAME = "C:\WINDOWS\system32\Notepad.exe"
  11.  
  12. Set objShell = CreateObject("Wscript.Shell")
  13.  
  14. 'Start application
  15. objShell.Run APPLICATION_NAME
  16.  
  17. 'Lock computer
  18. objShell.Run "%windir%\System32\rundll32.exe user32.dll,LockWorkStation"
  19.  
  20. 'End of loadAppAndLock.vbs
  21.  
One concern with this method is that there is a period of time between when the logon happens and the lock where your computer will be logged on and presumably unattended. Do some tests and decide if it's appropriate for your situation. For me it's about 5 seconds.

Add a post if you'd like any further clarification.

Hope that helps,

Chris Fry
Canberra, Australia
Oct 25 '07 #11
Killer42
8,435 Recognized Expert Expert
Thanks for the info, Chris. I'm sure many of us (myself included) will find it useful.
Oct 25 '07 #12
chrisfry
6 New Member
A couple of minor corrections - I tried the "shift" thing to stop auto logon, but it didn't work for me :-)
It probably either only works with the second auto logon method on the site I referenced using the Tweak UI PowerToy (I haven't tried that) or requires a PS2 keyboard.

Also, the omissions to get rid of the application start up should have been lines 9, 10, 14 and 15.

Chris
Oct 25 '07 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1860
by: Ciaran | last post by:
Hi All, I have created a Windows Service. In the event of an Exception occuring I would like to notify Windows to restart the service as shown below: <snip> protected override void...
17
2874
by: Bonj | last post by:
Right guys. (I would like a solution to this in VB6 as this is what our needy app is written in, but any solutions that involve .NET would be much appreciated likewise as I could instantiate...
1
7148
by: carmen | last post by:
Hi, I have searched through msdn documentation, but couldnt figure this out. I have written a console application that starts a process using the Process class in system.diagnostics namespace. I...
6
1698
by: Maximus | last post by:
Hi everybody, Has anyone changed the session state in web.config programatically through the applications. Any Help will be appreciated. Thanks.
4
2687
by: vickaiser1 | last post by:
I am creating a setup project for an application and need to edit the Metabase.xml file during setup. Does anyone know of a way to stop and then restart services programatically before and after I...
7
7212
by: shai | last post by:
I am working at .net 1.1, writing in c#. I have windows service with a COM object. Every unexpected time The COM object throw an error that make my service get stuck (do not respond). I can catch...
4
21682
by: carson | last post by:
I have written two windows services: - service A does some crunching of local data files and uploads them to a central processing computer via http. - service B monitors a manifest file on a...
4
1601
by: Simon Harvey | last post by:
Hi all, Can anybody tel me how to programatically kill my service when an exception occurs? Whenever something bad happens I'd like to shut it down. Also, is there a way to programatically...
7
6736
by: The Mad Ape | last post by:
Hi I have code to programatically create a label. It works but when I try to call a sub to create a tooltip it does not work. I do not get an error so have no idea what it wrong. Please review...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7463
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.