|
thank you very much Alan. But it is my own computer. I in project to make an internet cafe software for my own i-cafe. So, i think i may do that...even it is must...
modified on Wednesday, December 29, 2010 4:55 AM
|
|
|
|
|
I once set up a PC-based casino for a client. The only solution I found, other than the ability to disable the shutdown button, was to put the PCs in locked boxes, so the user could not hit the BRB (big red button).
|
|
|
|
|
Yes, absolutely. But i can prevent the shutdown verry well in windows xp without disable the BRB. But it seems this way does'nt work on windows vista and 7. Then, when i add code to send "ESC key" when dialog screen in vista & 7 for force to close application, now i can prevent shutdown too in vista and 7. But i still have problem with "switch user" and "sleep" option, and if we press ctrl+alt+del. I never found suitable code for disable the ctrl+alt+del in vista & 7 like in windows xp.
|
|
|
|
|
Yance Lawang wrote: Then, when i add code to send "ESC key" when dialog screen in vista & 7 for force to close application, now i can prevent shutdown too in vista and 7
Really? I'd be willing to bet that the only thing you tested this against was clicking the Shutdown button.
You didn't test it against Start -> Run -> SHUTDOWN /F.
You also didn't test it against Start -> Run -> TASKKILL ...
|
|
|
|
|
Yes, of course it is not possible. But i'm not worried about it, because i have disable run, cmd, task manager, hiding my application process (rename it), and any protection for windows registry.
|
|
|
|
|
Have you tested i-cafe software from www.handycafe.com[^]? This software can prevent shutdown even we use shutdown /f
|
|
|
|
|
Haha...i just have tested, my application can prevent shutdown using shutdown /f too in windows xp, but not work for windows 7
|
|
|
|
|
Yance Lawang wrote: ...But it is my own computer...
Ok, now I understand. The way you had worded it before I was worried about the security of other people's machines.
Apologies for the misunderstanding.
Everybody SHUT UP until I finish my coffee...
|
|
|
|
|
It's ok. Do you have any suggestion for that?
|
|
|
|
|
Yance Lawang wrote: It's ok. Do you have any suggestion for that?
No I don't. I'm no expert, but I think perhaps the operating system would view what you're trying to do as an attempt to "take over" the system. This is because your program would be interfering with a system process. With security being such an important issue these days, I doubt Windows will permit it.
Everybody SHUT UP until I finish my coffee...
|
|
|
|
|
Anti-virus programs sometimes prevent Windows from shutting down when you run executables that are not trusted and the anti-virus blocks the behavior.
Then you cannot even shutdown windows using the shutdown forcefully command from the command prompt. You have to turn off the power on the machine.
|
|
|
|
|
Yes.....so, do you know the code to do that?
|
|
|
|
|
go to the command prompt and type in shutdown /?
Then you can chose the syntax that you want such as
shutdown -s (shutdown)
shutdown -r (restart)
shutdown -f -t5 (forcefully in 5 seconds)
|
|
|
|
|
go to the command prompt and type in shutdown /?
Then you can chose the syntax that you want such as
shutdown -s (shutdown)
shutdown -r (restart)
shutdown -f -t5 (forcefully in 5 seconds)
You can use Shell, ShellExecute, ... to run this
|
|
|
|
|
Thank you, but i mean how to prevent the shutdown command even in windows vista & 7?
|
|
|
|
|
Are you just trying to prevent the automatic reboot with windows update? You can modify the registry
HKEY_LOCAL_MACHINE
"SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate\\AU"
"NoAutoRebootWithLoggedOnUsers"
1
|
|
|
|
|
No, i'm in project to build an i-cafe software for my own i-cafe. I want to prevent user to shutdown/loggof/reboot/sleep/etc. My code work well in windows xp without any problem, but not in vista/7.
|
|
|
|
|
Sorry, then I'm not sure that I can help you. I am still using XP.
|
|
|
|
|
anyway thanks for your help...
|
|
|
|
|
Yes, but those are services running under System accounts. If you don't have th permissions, you can't stop those services. His app is under user-mode, which can be easily stopped.
|
|
|
|
|
Yeah, you're right. Handycafe is so easy to terminate. But what is the code for fully prevent windows shutdown like what handycafe do?
|
|
|
|
|
Hi Everybody!
I've been getting increasingly annoyed at my computer today owing to a most peculiar problem. Whenever I run my VB.NET 2010 console application with no command-line arguments, the icon in the console window caption is displayed as my application's icon just as it should be.
However, when the application is run with one or more command-line arguments, the correct icon is not displayed, and is replaced by the default icon for executable files. Does anybody know why on earth this is happening and what I can do to solve it?
Thanks in advance!
MrWolfy
|
|
|
|
|
I'm afraid there isn't enough information to work on.
- How do you launch your console app? inside a "Command Prompt"? using an Explorer shortcut?
- What is your operating system?
- Does your code do anything at all regarding its icon(s)?
- what are the icon sizes you provided in the .ico file?
suggestion: try on different machines, also running different Windows versions.
|
|
|
|
|
Hi!
Sorry if my question was slightly brief, here's the information you requested:
- The icon displays correctly when launched from windows explorer by double-clicking the program icon. When I launch it in debug mode from VB Express it's icon does not display at all, regardless of command line arguments (though I assume that this has something to do with the Visual Studio hosting process). When launched from "cmd.exe", the icon remains as the standard icon for the command prompt regardless of arguments provided.
When the program is launched because a file of a type associated with it (through the registry) is double-clicked in windows explorer, the icon does not display correctly, the default executable icon is used instead.
- My OS is Windows 7 Home Premium.
- My code does not alter the caption icon in any way.
- The icon sizes in the .ico file are 256x256, 128x128, 48x48, 32x32, 24x24 and 16x16 all of which are in 32-bit colour.
Until about 2 minutes ago, I had assumed that it was the command-line arguments that were causing this problem, but it appears to be the fact that the application is being launched through opening an associated file type with it. The DefaultValue value in the shell/open/command registry key associated with the file type is:
"C:\MyApplication" "%1"
I'm sorry for neglecting to make this clear in the first place.
MrWolfy
|
|
|
|
|
No problem.
You could try once more with Visual Studio, however with the hosting process disabled (there's a checkbox in the project settings somewhere).
MrWolfy wrote: When launched from "cmd.exe", the icon remains
I'm not sure but I think that is normal.
Best would be for you, or somebody else, to try some console app on another Windows version. It could just be the way things are...
|
|
|
|