Jump to content

Recommended Posts

Posted

How do you do this...

 

This is my batch and it does not seem to want to work:

 

regedit /l:c:\windows\system.dat /r:c:\windows\user.dat /d HKEY_CURRENT_USER\Software\Adobe\Dreamweaver CS5.5

regedit /l:c:\windows\system.dat /r:c:\windows\user.dat /d HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Dreamweaver

 

SHUTDOWN -r -t 10

Posted

Have you tried using the REG DELETE command instead?

 

REG DELETE KeyName [/v ValueName | /ve | /va] [/f]

 KeyName    [\\Machine\]FullKey
   Machine  Name of remote machine - omitting defaults to the current machine.
            Only HKLM and HKU are available on remote machines.
   FullKey  ROOTKEY\SubKey
   ROOTKEY  [ HKLM | HKCU | HKCR | HKU | HKCC ]
   SubKey   The full name of a registry key under the selected ROOTKEY.

 ValueName  The value name, under the selected Key, to delete.
            When omitted, all subkeys and values under the Key are deleted.

 /ve        delete the value of empty value name (Default).

 /va        delete all values under this key.

 /f         Forces the deletion without prompt.

Examples:

 REG DELETE HKLM\Software\MyCo\MyApp\Timeout
   Deletes the registry key Timeout and its all subkeys and values

 REG DELETE \\ZODIAC\HKLM\Software\MyCo /v MTU
   Deletes the registry value MTU under MyCo on ZODIAC

Posted

regedit.exe only accepts a .reg file to make edits to the registry - where did you get that syntax?

 

So you could call regedit on an existing .reg file or be a bit smarter and use itself as the reg file so something like this:

REGEDIT4


; @echo OFF
; CLS
; REGEDIT.EXE /S "%~f0"
; EXIT


[-[color=#333333]HKEY_CURRENT_USER\Software\Adobe\Dreamweaver CS5.5[/color]]
[color=#333333][-HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Dreamweaver][/color]

Posted (edited)
regedit.exe only accepts a .reg file to make edits to the registry - where did you get that syntax?

 

Reg is command-line though. ( C:\Windows\System32\reg.exe NOT C:\Windows\regedit.exe )

 

- Edit: As sparkeh said, regedit only works with .reg files now. You can only use /d in 98/ME

 

Steve

Edited by Steve21
Posted

Batch files - Use REGEDIT to add, read or delete registry values

 

[h=2]Removing registry entries[/h]To remove an entire "tree" from the registry using REGEDIT and a .REG file, just add a minus sign before the tree name:

 

REGEDIT4[-HKEY_CURRENT_USER\DummyTree]will remove the entire tree "DummyTree".

To remove an individual item from the registry, place the minus sign after the equal sign:

 

REGEDIT4[HKEY_CURRENT_USER\DummyTree]"ValueToBeRemoved"=-will remove the individual value "ValueToBeRemoved" from "DummyTree".

This is demonstrated in the UniqueID.bat example below, a batch file that forces a new LANDesk agent ID.

How to remove an individual registry key or value using *.INF files and RUNDLL is explained by Bill James.

Posted
regedit.exe only accepts a .reg file to make edits to the registry - where did you get that syntax?

 

So you could call regedit on an existing .reg file or be a bit smarter and use itself as the reg file so something like this:

REGEDIT4


; @echo OFF
; CLS
; REGEDIT.EXE /S "%~f0"
; EXIT


[-[color=#333333]HKEY_CURRENT_USER\Software\Adobe\Dreamweaver CS5.5[/color]]
[color=#333333][-HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Dreamweaver][/color]

 

Do i need the ; ?

Posted

also that did not work, and neither did:

REGEDIT4[-HKEY_CURRENT_USER\Software\Adobe\Dreamweaver CS5.5]

REGEDIT4[-HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Dreamweaver]

Posted (edited)

To delete the registry keys via RegEdit you need to copy-and-paste the following code into Notepad, save it as a .reg file (e.g. Adobe.reg) and then run regedit /s Adobe.reg.

 

Windows Registry Editor Version 5.00

[-HKEY_CURRENT_USER\Software\Adobe\Dreamweaver CS5.5]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Dreamweaver]

 

To delete the same registry keys via Reg.exe, you would do this...

 

reg delete "HKCU\Software\Adobe\Dreamweaver CS5.5" /f
reg delete HKLM\SOFTWARE\Adobe\Dreamweaver /f

 

Which account are you running your batch file under? If it's the SYSTEM account, there isn't any point in trying to delete the HKEY_CURRENT_USER registry key because it won't exist.

 

Btw, semi-colons are just comments so can be ignored if you want.

Edited by Arthur
  • Thanks 2
Posted

There must be something wrong with these images, because I cant get Dreamweaver CS5.5 to show up in the wmic product list

 

Every other adobe app shows up. When i run a 3rd party uninstall program, i can locate the UUID of the install, but any attempt to modify / repair / uninstall says "This option is only for install packages". Yet when I got to add/remove programs it can be uninstall that way.

 

Frustrating!

Posted
I can't get Dreamweaver CS 5.5 to show up in the wmic product list

WMIC will only list applications installed via Windows Installer i.e. MSIs not EXEs.

 

Was Dreamweaver installed as part of the Creative Suite?

Posted

Btw, semi-colons are just comments so can be ignored if you want.

Not entirely true.

The code I posted above is a kind of reg file/batch file in one. In reg files the ; means a comment, the batch file will ignore the ; and process the commands.

When you run regedit with that code you need the REGEDIT4 line to make it a valid reg file, however when run as a batch file it will throw an error. The CLS line simply clear the error. And you need the regedit line to actually call regedit so that really can't be ignored ;)

  • Thanks 1
Posted
Not entirely true.

The code I posted above is a kind of reg file/batch file in one. In reg files the ; means a comment, the batch file will ignore the ; and process the commands.

When you run regedit with that code you need the REGEDIT4 line to make it a valid reg file, however when run as a batch file it will throw an error. The CLS line simply clear the error. And you need the regedit line to actually call regedit so that really can't be ignored ;)

 

Not being brilliant with batch files, how does the last bit of this line point to itself or know where itself is ??

 

 

; REGEDIT.EXE /S "%~f0"

Posted

The %~f0 on the end expands to the fully qualified path of the .cmd/.bat file so you don't have to hard-code it in your batch file. There are lots more you can use too...

 

%~0         - expands %I removing any surrounding quotes (")
%~f0        - expands %I to a fully qualified path name
%~d0        - expands %I to a drive letter only
%~p0        - expands %I to a path only
%~n0        - expands %I to a file name only
%~x0        - expands %I to a file extension only
%~s0        - expanded path contains short names only
%~a0        - expands %I to file attributes of file
%~t0        - expands %I to date/time of file
%~z0        - expands %I to size of file

The modifiers can be combined to get compound results:
%~dp0       - expands %I to a drive letter and path only
%~nx0       - expands %I to a file name and extension only
%~fs0       - expands %I to a full path name with short names only

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...