registry

Batch file: run command in a cmd.exe launched as a different user using batch file

北慕城南 提交于 2019-12-24 04:31:05
问题 Hi Folks I am a newbie to batch files and I am facing a challenge. I have to do following steps using a batch file automatically. Steps 1 and 3 I am able to figure out, however for step 2 i need your help: A. Run command prompt using a user: Comment: This I have figured out, I can do it using: @Echo Off runas /profile /savecred /user:xyzasa\asdasq "cmd" B. Make some registry changes using the command prompt which opened in the previous step Comment: I know this can be done using the reg add

RegDeleteKey and RegDeleteKeyEx

不羁的心 提交于 2019-12-24 04:02:47
问题 I am writing an app which will remove some Registry keys recursively using API RegDeleteKey or RegDeleteKeyEx . What is bothering me is that RegDeleteKeyEx is not defined for less than XP x64 Professional , so now this limitation is limiting my app. Is there any way in which I can use both APIs with compatibility from XP x86 to Win7 x64 ? 回答1: In order for your app to run in old systems where RegDeleteKeyEx does not exist, you need to avoid static linking to this API. That is, you don't use

WiX Add Registry Key to Customize Context Menu

痴心易碎 提交于 2019-12-24 03:51:21
问题 I want to create an .msi installer that will add a cascading context menu when I right-click my mouse on my desktop. First, I tried doing this using the following script, and this works fine: [HKEY_CLASSES_ROOT\DesktopBackground\Shell\MyApp] "MUIVerb"="My Application" "SubCommands"="app1;app2" "Position"=- [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\app1] @="Run App1" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer

in x64 Windows is there a way to run a Runtime.exec() process avoiding 'Registry redirection'

馋奶兔 提交于 2019-12-24 03:49:09
问题 Our app runs in jvm 32 bit, even when in windows x64. Now, at some point, I need to access some registry values, for example HKEY_LOCAL_MACHINE/SOFTWARE/mycomp. I do this by executing cmd /C reg query HKEY_LOCAL_MACHINE\SOFTWARE\mycop from Runtime.exec() and parsing the output. This works fine when running on windows 32b, the problem is when on x64, I cannot find the key, as the shell I run is a 32 bit process, and due to Registry Redirection I would get the key if it was on HKEY_LOCAL

C# change windows UAC level to Always Notify

孤者浪人 提交于 2019-12-24 03:27:54
问题 I want to change the UAC level of the machine to "Always Notify" level which is the top level. I tried changing the following registry key value to 1. Key = HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System const string UACkey = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"; const string Subkey = "EnableLUA"; RegistryUtilities.SetValue(UACkey, Subkey, **1**, Microsoft.Win32.RegistryValueKind.DWord, RegistryUtilities.WOW64Key.Key64);

Launch app on startup for all users, but also allow per-user setting (Windows)

一个人想着一个人 提交于 2019-12-24 03:26:24
问题 I need my application installer set the program to auto-startup for all users. Then each individual user should be able to modify this option without affecting others. Currently I write to HKLM/../Run with installer, which acomplishes the first task. But then I can't disable autorun for current user, because deleting th HKLM/../Run entry would disable it for everybody. Is there a way to do that, without using shortcuts in Autostart folder? 回答1: start it for all users always but check a

Setting Registry Key For All Users In C#

Deadly 提交于 2019-12-24 03:12:24
问题 I have an application that changes some registry values during installation. I am changing ProxyEnable and ProxyServer in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings. This works great when installing as "Just Me" in the .NET installer however I would like to set these values for all users on the computer (Everyone). My application is a proxy server that will log all URL requests that it receives. For this to work it requires the proxy values to be setup in

Edit environment variable in registry

余生颓废 提交于 2019-12-24 02:45:29
问题 I want to read all environment variable from the registry and set a new value for it with c# in visual studio 2010 express. Thus I read the subkey of local machine: SYSTEM\CurrentControlSet\Control\Session Manager\Environment and there the value of Path . While reading the Path value: reg = Registry.LocalMachine.OpenSubKey(SUB_KEY_PATH, true); I get an exception, that i don't have the permission for it. Therefore I set the value in the manifest: <requestedExecutionLevel level=

How i can add a Entry to Shell Menu only on drive C:\?

蹲街弑〆低调 提交于 2019-12-24 02:44:27
问题 I need to add a Context Menu Item to Explorer Shell in Windows. This is easy doing by adding some Registgry Entry: [HKEY_CLASSES_ROOT\Drive\shell\Disk cleanup\command] @="cleanmgr.exe" but i like to add this entry only for drive C:\ or so. How i can do this? Thanks! 回答1: Try this. (Works on Windows 7 here.) [HKEY_CLASSES_ROOT\Drive\shell\Disk cleanup\command] @="cleanmgr.exe" "AppliesTo"="C:" See Creating Shortcut Menu Handlers and Advanced Query Syntax for more about the AppliesTo field. I

Java accessing Window's “Open with…” list

扶醉桌前 提交于 2019-12-24 02:25:13
问题 I would like to get the list of "Open with..." contextual menu in Windows XP/Vista/7 from Java. From the Windows Registry, I've managed to find a way to get the command to launch applications. But I did not find out how to get these applications names and icons as shown in the Explorer Open with list contextual menu. Also, the way to manage these informations seems to change from one version of the OS to another. Is there any library I could use with Java for this ? Thanks. 回答1: You don't