Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

HELP! .reg to Javascript.

Featured Replies

OKAY here is the reg key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"WPI"=-

NOTE This is DELETING the sub-key of WPI.

Now the issue is I can get it to delete the whole run section (Not very good) But not just the sub-key.

I have the function DeleteRunEntry built in that will call this function I just need the javascript to delete a sub-key.

ANY IDEAS?

hi kelsenellenelvian

i think that this is the answer to your post (i hope)

Deleting Registry Keys and Values

To delete a registry key with a .reg file, put a hyphen (-) in front of the RegistryPath in the .reg file. For example, to delete the Test subkey from the following registry key:

HKEY_LOCAL_MACHINE\Software

put a hyphen in front of the following registry key in the .reg file:

HKEY_LOCAL_MACHINE\Software\Test

The following example has a .reg file that can perform this task.

[-HKEY_LOCAL_MACHINE\Software\Test]

To delete a registry value with a .reg file, put a hyphen (-) after the equals sign following the DataItemName in the .reg file. For example, to delete the TestValue registry value from the following registry key:

HKEY_LOCAL_MACHINE\Software\Test

put a hyphen after the "TestValue"= in the .reg file. The following example has a .reg file that can perform this task.

HKEY_LOCAL_MACHINE\Software\Test

"TestValue"=-

To create the .reg file, use Regedit.exe to export the registry key that you want to delete, and then use Notepad to edit the .reg file and insert the hyphen.

the full link is

http://support.microsoft.com/kb/310516/en-us

:hello: newbie1

OKAY here is the reg key:

var WshShell = WScript.CreateObject("WScript.Shell");
gVal = "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\WPI";
try{
WshShell.RegDelete(gVal);
}
catch(e){
var sTest = e.description.substr(0,7);
if(sTest=="Unable "){
WshShell.Popup("value does not exist");
}
else {
if(sTest=="Invalid"){
WshShell.Popup("key does not exist");
}
else {
WshShell.Popup(e.description);
}
}
}

  • Author

OKAY Here is the idea I have (Let me try to clarify it better.)

In the options installer tab I added a function called "Deleterunentry" I added this entry because I want users to be able to have WPI load AFTER the desktop has loaded BUT to do this i need to add WPI to the run list like a regular prog. However I don't think we really need to make WPI load everytime a user reboots *silly*. Now the problem is I need the installer.hta to delete the entry on the beggining of the installation process but only if the user has selected this option in the options menu.

SO it needs to be: (In installer.hta like so)

<script type="text/javascript">
if (ResumeInstall)

That deletes the key exactly as this regentry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"WPI"=-

I have tried all I can think of and I am prolly just bein stupid.

Kel,

I'm hoping you are looking for something like this in java script:

function Deleterunentry()
{
position="api.js";
whatfunc="Deleterunentry()";

var wsh = new ActiveXObject("WScript.Shell");

try
{
wsh.RegDelete("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\WPI");
}
catch (ex)
{; }
}

Oops, Sorry about that Yzöwl, didn't look through the dropdown .js section of your code well enough...that was where I was going. Kel, did Yzöwl's code not help?

Edited by lawrenca

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.