Cannot Open Devcon - driver

I installed WinDDK 7600 in my Windows XP operating system.Now,when I double click the devcon.exe(Location- D:\WinDDK\7600.16385.1\tools\devcon\i386),the command prompt is just showing up and suddenly disappears.Can anyone resolve this issue.

As far as I'm aware devcon is a command-line only program. You have to run it from a command window (cmd.exe) with the appropriate parameters. Once you know the parameters you want to use, you can write a batch file to easily recreate the command you want.

I ran across this post because Win7 has a similar problem even when running in cmd.exe.
There is a solution found on Microsofts website here:
http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/devcon-not-working-correctly-in-windows-7/9abcc12c-d7db-4249-aec4-fc4ff0ea6ee8
I have not been able to verify it yet.

The same (a windows open and automatically close) happens even if using a normal command prompt. However opening the command prompt with administrator rights and then run devcon works.

Related

OAuth error when attempting to start-host for chrome-remote-desktop on GCE

I'm running CentOS 7 in a Google Compute Engine VM, and trying to connect to it via Chrome Remote Desktop. When I run the start-host command, it fails with "OAuth error" and no more information.
I accessed the https://remotedesktop.google.com/headless site with Chrome, filled out the choices, and went through the authorization phase. There was not an option for CentOS, so I chose "Debian" and when it gave me the connect command, I replaced the path to start-host with the CentOS one of /usr/lib64/chrome-remote-desktop/start-host, and running the resulting command fails.
I did the likely web searches and found some fairly old and unhelpful information, but nothing useful.
If I can't get Chrome Remote Desktop working, I'd be willing to try another method to run GUI-based applications (in this case, IBM's oneWEX). I can get X11 to sort-of work remotely, but not well enough to run oneWEX.
This is the command I got from the Chrome site, modified to work with CentOS:
DISPLAY= /usr/lib64/chrome-remote-desktop/start-host --code="<code>" --redirect-url="https://remotedesktop.google.com/_/oauthredirect" --name=
The start-host command asked the expected questions of the computer name and PIN, then gave the error:
Couldn't start host: OAuth error.
When you get the code from https://remotedesktop.google.com/headless it is only good for a few minutes, and only one time use.
Just go back to https://remotedesktop.google.com/headless follow the prompts and get a new code for every attempt.
In my case, I got another error when I first ran the command. I tried to resolve it, and reran the same command (with the original code). I kept getting the "Couldn't start host: OAuth error." until I figured out I needed to get a new code from https://remotedesktop.google.com/headless for each attempt.
FYI: The error message is not given right away, but after entering the computer name and double entering the pin.
According to https://bugs.chromium.org/p/chromium/issues/detail?id=1039016, this could apparently also happen if the /usr/lib64/chrome-remote-desktop/start-host binary is not one from the "official" DEBian package built and distributed by Google, but one built from source e.g. by yourself or your Linux distribution (such as the chrome-remote-desktop package built by Fedora; https://bugzilla.redhat.com/show_bug.cgi?id=1788448 aims to clarify how to use that one).
What I can see here is that you previously added some libraries to your CentOS instance, I tried replicating the error myself and inside my CentOS 7 instance (from Compute Engine) I don't seem to have any /usr/lib64/chrome-remote-desktop/ folder.
Or is it from your local machine?
I had the same error and found that refreshing the headless page to get a new code string in the command worked.

How to fix strange symbols displayed in cmd

Hello,
I'm using bash or cmd for Rails console.
I get this weird symbols like <-[1m.
In my tutorial I see the output fine (With spaces and color), and it's difficult to read it in my cmd...
Can you help me to display those special characters right?
Thanks!
Instead of using cmd, run rails and ruby through cygwin, it works better than cmd as cygwin is supposed to bring you a linux environnement on windows. When i tried to do rails on windows it was the most complete tool.
I insist on the fact that you should use a Linux VM to do rails on windows. If you install VMWare player on your windows, you will have a virtual machine running in vmware on your windows desktop. This machine will be connected to you network. I strongly advise you to use this solution, as you will encounter many problems using rails on windows.
I work on windows, and i have a Virtual Ubuntu always launched. My VM share the code via samba and i edit it with sublim text executed in windows. On my second screen i have my VM full screen that display multiple terminals.
Ok, I found this wonderful software https://code.google.com/p/conemu-maximus5/ and it did solve my problem :)
cmd.exe doesn't understand those color codes.
There is a project to make cmd understand them (and add other useful feaures) here. I do not use windows, so I cannot vouch for the quality of it.

FSharp interactive on CentOS 6.2 with Mono 2.10.2 won't run as non-root

Hopefully this has not been asked/answered before, but I haven't found anything that fits my issue.
I installed mono on CentOS 6.2 as described here using an rpm and then downloaded FSharp-2.0.0.0. I got it all set up and fsi works great (as long as I pass it the option --gui-) while as root. However, when I try to do it as a plain user I get an error telling me something about not being able to access the registry.
Here is a screenshot:
I'm not sure what the issue is (I've never used CentOS before, but a lab I work in does and I want to put FSharp on it for data processing -- thus I have to use CentOS, which I've read can be troublesome with mono). Thanks for any help!
I know little about CentOS, but the error message seems fairly clear, the mono process running fsi.exe does not have access to a file (the file path is given in the message). So it should be just a matter of running as root to give yourself access to the file, or better yet granting the current user access to this file via chmod (or similar tool).

PsExec gets stuck on licence prompt when running non-interactively

I have a Hudson build script which calls the SysInternals PsExec utility. Normally, when PsExec is run for the first time by a given user it pops up a dialog box asking the user to accept the licence. The build agent runs as a service and I can see that the build gets stuck at PsExec. Process Explorer shows that PsExec is running, so I strongly suspect it's displaying that same prompt, but because it's running non-interactively there is no way to accept the prompt. Is there any way to get around this silly limitation? Running on Windows Server 2008 R2 x64.
Use the /accepteula command-line switch to accept the licence agreement.
Or set
HKCU\Software\Sysinternals\PsExec\EulaAccepted
to 1
Caution: if the reg key above is set to 0 (EULA was declined once) then the /accepteula will not work, you have to set the key to 1 manually (or delete it altogether).
It's documented, but you have to use the 2003 version or higher.

How do you run CMD.exe under the Local System Account?

I'm currently running Vista and I would like to manually complete the same operations as my Windows Service. Since the Windows Service is running under the Local System Account, I would like to emulate this same behavior. Basically, I would like to run CMD.EXE under the Local System Account.
I found information online which suggests lauching the CMD.exe using the DOS Task Scheduler AT command, but I received a Vista warning that "due to security enhancements, this task will run at the time excepted but not interactively." Here's a sample command:
AT 12:00 /interactive cmd.exe
Another solution suggested creating a secondary Windows Service via the Service Control (sc.exe) which merely launches CMD.exe.
C:\sc create RunCMDAsLSA binpath= "cmd" type=own type=interact
C:\sc start RunCMDAsLSA
In this case the service fails to start and results it the following error message:
FAILED 1053: The service did not respond to the start or control request in a timely fashion.
The third suggestion was to launch CMD.exe via a Scheduled Task. Though you may run scheduled tasks under various accounts, I don't believe the Local System Account is one of them.
I've tried using the Runas as well, but think I'm running into the same restriction as found when running a scheduled task.
Thus far, each of my attempts have ended in failure. Any suggestions?
Though I haven't personally tested, I have good reason to believe that the above stated AT COMMAND solution will work for XP, 2000 and Server 2003. Per my and Bryant's testing, we've identified that the same approach does not work with Vista or Windows Server 2008 -- most probably due to added security and the /interactive switch being deprecated.
However, I came across this article which demonstrates the use of PSTools from SysInternals (which was acquired by Microsoft in July, 2006.) I launched the command line via the following and suddenly I was running under the Local Admin Account like magic:
psexec -i -s cmd.exe
PSTools works well. It's a lightweight, well-documented set of tools which provides an appropriate solution to my problem.
Many thanks to those who offered help.
Download psexec.exe from Sysinternals.
Place it in your C:\ drive.
Logon as a standard or admin user and use the following command: cd \. This places you in the root directory of your drive, where psexec is located.
Use the following command: psexec -i -s cmd.exe where -i is for interactive and -s is for system account.
When the command completes, a cmd shell will be launched. Type whoami; it will say 'system"
Open taskmanager. Kill explorer.exe.
From an elevated command shell type start explorer.exe.
When explorer is launched notice the name "system" in start menu bar. Now you can delete some files in system32 directory which as admin you can't delete or as admin you would have to try hard to change permissions to delete those files.
Users who try to rename or deleate System files in any protected directory of windows should know that all windows files are protected by DACLS while renaming a file you have to change the owner and replace TrustedInstaller which owns the file and make any user like a user who belongs to administrator group as owner of file then try to rename it after changing the permission, it will work and while you are running windows explorer with kernel privilages you are somewhat limited in terms of Network access for security reasons and it is still a research topic for me to get access back
Found an answer here which seems to solve the problem by adding /k start to the binPath parameter. So that would give you:
sc create testsvc binpath= "cmd /K start" type= own type= interact
However, Ben said that didn't work for him and when I tried it on Windows Server 2008 it did create the cmd.exe process under local system, but it wasn't interactive (I couldn't see the window).
I don't think there is an easy way to do what you ask, but I'm wondering why you're doing it at all? Are you just trying to see what is happening when you run your service? Seems like you could just use logging to determine what is happening instead of having to run the exe as local system...
Using Secure Desktop to run cmd.exe as system
We can get kernel access through CMD in Windows XP/Vista/7/8.1 easily by attaching a debugger:
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\osk.exe" /v Debugger /t REG_SZ /d "C:\windows\system32\cmd.exe"
Run CMD as Administrator
Then use this command in Elevated:
CMD REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\osk.exe" /v Debugger /t REG_SZ /d "C:\windows\system32\cmd.exe"
Then run osk (onscreenkeyboard). It still does not run with system Integrity level if you check through process explorer, but if you can use OSK in service session, it will run as NT Authority\SYSTEM
so I had the idea you have to run it on Secure Desktop.
Start any file as Administrator. When UAC prompts appear, just press Win+U and start OSK and it will start CMD instead. Then in the elevated prompt, type whoami and you will get NT Authority\System. After that, you can start Explorer from the system command shell and use the System profile, but you are somewhat limited what you can do on the network through SYSTEM privileges for security reasons. I will add more explanation later as I discovered it a year ago.
A Brief Explanation of how this happens
Running Cmd.exe Under Local System Account Without Using PsExec. This method runs Debugger Trap technique that was discovered earlier, well this technique has its own benefits it can be used to trap some crafty/malicious worm or malware in the debugger and run some other exe instead to stop the spread or damage temporary. here this registry key traps onscreen keyboard in windows native debugger and runs cmd.exe instead but cmd will still run with Logged on users privileges, however if we run cmd in session0 we can get system shell. so we add here another idea we span the cmd on secure desktop remember secure desktop runs in session 0 under system account and we get system shell. So whenever you run anything as elevated, you have to answer the UAC prompt and UAC prompts on dark, non interactive desktop and once you see it you have to press Win+U and then select OSK you will get CMD.exe running under Local system privileges. There are even more ways to get local system access with CMD
an alternative to this is Process hacker if you go into run as... (Interactive doesnt work for people with the security enhancments but that wont matter) and when box opens put Service into
the box type and put SYSTEM into user box and put C:\Users\Windows\system32\cmd.exe leave the rest click ok and boch you have got a window with cmd on it and run as system now do the other steps for yourself because im suggesting you know them
There is another way. There is a program called PowerRun which allows for elevated cmd to be run. Even with TrustedInstaller rights. It allows for both console and GUI commands.
(Comment)
I can't comment yet, so posting here... I just tried the above OSK.EXE debug trick but regedit instantly closes when I save the filled "C:\windows\system32\cmd.exe" into the already created Debugger key so Microsoft is actively working to block native ways to do this. It is really weird because other things do not trigger this.
Using task scheduler does create a SYSTEM CMD but it is in the system environment and not displayed within a human user profile so this is also now defunct (though it is logical).
Currently on Microsoft Windows [Version 10.0.20201.1000]
So, at this point it has to be third party software that mediates this and further tricks are being more actively sealed by Microsoft these days.
if you can write a batch file that does not need to be interactive, try running that batch file as a service, to do what needs to be done.
I use the RunAsTi utility to run as TrustedInstaller (high privilege). The utility can be used even in recovery mode of Windows (the mode you enter by doing Shift+Restart), the psexec utility doesn't work there. But you need to add your C:\Windows and C:\Windows\System32 (not X:\Windows and X:\Windows\System32) paths to the PATH environment variable, otherwise RunAsTi won't work in recovery mode, it will just print: AdjustTokenPrivileges for SeImpersonateName: Not all privileges or groups referenced are assigned to the caller.
Using task scheduler, schedule a run of CMDKEY running under SYSTEM with the appropriate arguments of /add: /user: and /pass:
No need to install anything.
i used Paul Harris recommendation and created a batch file .cmd or .bat with what ever command i needed to run under system and used the schedule task run one time.
than trigger it as needed. and updated the batch as needed. so any command i need to run under system i just update the batch.

Resources