I have a requirement to trigger a reboot on a windows7 machine programmatically. This is to support a scenario for customers where when they log out of an intenet kiosk machine the machine reboots. On XP this was achieved using WTSSystemShutdown but Im wondering if theres another way. Any pointers greatly appreciated.
You can call ExitWindowsEx to restart, shutdown, logoff, etc.
Use InitiateShutdown (Vista) or InitiateSystemShutdownEx (Win2k or higher) to shutdown a computer remotely.
I answered a similar question here (complete with sample code):
Log off user from Win XP programmatically in C# (ExitWindowsEx)
Just change the uFlags parameter to ExitWindows.Reboot.
Related
Bear with me please, since I don't know that much about Windows – I'm trying to set up UWF (Unified Writing Filter) here on my mac through a Parallels installation of Windows 10. I found out how to enable UWF through the Control Pane, which I did. I then restarted the Virtual Machine. When I then tried to configure it through the powershell or command prompt (both run in admin mode), I got no response whatsoever. The uwfmgr.exe is there under c:\windows\system32, but like I said, it doesn't do anything when I run it. No response – but also, no error.
Can anyone help me with this?
I had the same issue and solved it by downloading the latest ISO for 10 Enterprise.
It seems you need a Windows 10 Enterprise edition for this to work. Just re-activating windows with an Enterprise key makes uwfmgr.exe print stuff again. Just testing, whether it works as well.
This was tested on Windows 10, V1809.
I have a little network of a couple of machines at home, and I need to shutdown them at a certain hour.
I found out that Windows 7 from Pro upwards offers a graphical Security Policies editor, where it's possible to allow the remote shutdown, but apart from mine, the other PCs have just Home Premium, which doesn't have the editor.
I found out that the key is editable without the need of the editor, but how, and where do I find it?
Or, are there any other ways? Thanks for the help.
I have never done what you are trying to do in regards to remote shutdown, but here is some information that may be useful:
Are you using the group policy editor for Windows 7 Pro? I believe that's gpedit.msc, right? Back in the day it used to be that you could use regmon (a Sysinternals program) to monitor registry keys that are changed, but it looks like Microsoft bought out Sysinternals and then retired Regmon. However, I believe they moved the functionality to Process Explorer (edit: turns out it's Process Monitor):
Monitor: http://technet.microsoft.com/en-us/sysinternals/bb896645
Explorer: http://technet.microsoft.com/en-us/sysinternals/bb896653
On your Windows 7 Pro machine run process monitor and set it up to monitor registry changes for gpedit.msc. Then change the setting using the program. Once you have the key you can document it or export it using regedit. I'm not sure how you plan on changing the registry key remotely, though.
I have computers where I want to run OpenCL apps remotely using a command line tool, something like the problem described here: http://devgurus.amd.com/thread/160690, but I am with nVIDIA hardware.
I have several computers with W7 and XP where I did install cygwin and OpenSSH. The XP ones, work OK with OpenCL, but not the W7 ones.
Is there any flag, trick, setting that can help be to overcome this problem of Windows? Or in SSHD server?
Found the solution myself:
The easyer way to overcome this problem is to use PSEXEC tool from sysinternals.
However, there are some problems with this tool too.
In order to work properly it is needed:
An account in the remote computer with proper rights (Admin preferable)
Launch PSEXEC in interactive mode (-i), otherwise the access to the GPU is not available.
Have a local user connected, or a local user was the last one to connect. If a RDP session is running or the last user connecting has been trough RDP it will likely not work too. Since the GPU will already be disabled.
I am open to accept anyone else's better answer.
Thank you!
Before I start, another post for something similar to this request for help is located at Running a process at the Windows 7 Welcome Screen, but the responses were not quite what I believe I am looking for, and the post is over a year old so I thought it best to start a new thread for my needs.
In Windows 7 Ultimate, I am trying to create a script or task scheduler event that will run a Windows "rundll32.exe" process with arguments at the logon, lock, and switch user screens (basically any screen that is waiting for user to log into the machine).
I have tried using the startup script controls in group policy editor as well as creating a task scheduler event, but so far I am unable to get the process to display on the logon screens.
The command line I am using does work while logged into any account at any user level via the "Run.." dialog as well as via CMD prompt, and is only creating a popup that already exists in the Windows OEM Environment.
The hardest part is this: My friend just bought a new laptop. The new laptop came with this specific feature already enabled, but I have no idea what is making it happen and do not have access to the computer to check out gpedit.msc and task scheduler for possible solutions.
There are two reasons why I need this info: 1) I want the feature to work on my own laptop, and 2) my friend would like help disabling it on his as he doesn't like it.
I have been all over Google, posted at Microsoft Answers, and also posted on the laptop manufacturer's user forums. I have found very few pages that refer to the same question as I have, but none have answers that work, and since I have seen and know that this is possible, I am compelled to continue looking.
The laptop that this is currently working on was purchased with a fresh install of Win 7 Ultimate and no manufacturer bloatware/additional software added, so we know that the feature was made to happen by whomever it was that installed the OS and configured it for sale. Therefore I am certain it is just a matter of the right task or script in Windows itself before I see the results I need and then know how to direct my friend to disable his via phone.
The specific call is "rundll32.exe van.dll,RunVAN". In task scheduler I have set this to run as "SYSTEM" and set the triggers for startup, workstation lock, and local disconnect. I have tried using full path to rundll32.exe as well as the bare command. In gpedit startup scripts I have tried full path and bare command. Neither of which for either case is making this popup show on the logon screens.
Any and all help and/or advice on this would be greatly appreciated by both myself and my friend.
dynamic display of images for the credential provider
I have an application for Windows XP. This application is deployed with the hardware. The application is the only application that ever runs on these machines. These machines are never connected to the internet. I'm interested in instant-on (or quick-on) options that bypass the Windows XP startup for these machines.
This is similar to Windows XP "hibernation", but not exactly. With hibernation, the memory state is only read from disk once - the very next time the system is turned on. I want a memory state permanently stored to disk, so the system always starts from that same spot every time, regardless of how it was shut down. How can I achieve this?
Sounds like you're looking for the Hibernate Once, Resume Many feature of Windows Embedded.
If you like "hibernation", you may use VMWare.
Install a ArchLinux and VMWare on the host machines.
Prepare your Windows XP as the guest OS.
Customize startup process of the host, let it run VMWare and restore Windows to the snapshot.
Hmmm, the short answer is "not easily!", but one way could be to try playing around with replacing the windows shell with your own application / script that launches your own custom interface / state instead of Explorer as the default. Basically it's done using this reg key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\shell
Info on this actually seems to be reasonably scarce after doing a quick Google search, but this link below provides a little more detail:
http://www.trap17.com/index.php/how-change-windows-xp-shell_t20367.html
I think if you do a Google Groups search on "Windows XP shell replacement" you might get some more informative results.
You could try installing TweakUI on them, and having them autologin. Once you do that, just add your application to the Start Up menu (or in the registry, under:
HKLM\Software\Microsoft\Windows\CurrentVersion\Run
Jeff Atwood has a post on this very thing.