Topic
1 reply Latest Post - ‏2013-01-24T18:44:48Z by jeremylam
SystemAdmin
SystemAdmin
104 Posts
ACCEPTED ANSWER

Pinned topic Obtaining the values of specific registry keys to a batch file.

‏2013-01-10T19:58:00Z |
Need some assistance in figuring out what I am doing wrong. The resulting batch file is only echoing the complete line that I am asking instead of the values of the registry entries. Any assistancve is appreciated.

if ((exists keys whose ((it contains "Google Chrome") of (value "UninstallString" of it as string as lowercase)) of key "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of registry) AND ((exists keys whose ((it contains "Update") of (value "UninstallString" of it as string as lowercase)) of key "HKLM\SOFTWARE\Google" of registry)))
endif

delete __createfile
createfile until @end_create_file
appendfile @Echo Off
appendfile "Made it here 1"
appendfile (concatenation "%0d%0a" of (value "UninstallString" of it as string as lowercase) of key "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome" of registry)
appendfile (concatenation "%0d%0a" of (value "UninstallString" of it as string as lowercase) of key "HKLM\SOFTWARE\Google\Update" of registry)
appendfile {"Made it here 2"}
appendfile (C:\Program Files\Google\Google Toolbar\Component\GoogleToolbarManager_B12CA2CBE40DD1A2.exe /uninstall)
appendfile (C:\Program Files\Google\Chrome\Application\12.0.742.100\Installer\setup.exe --uninstall --system-level)
appendfile ("Made it her 3")
@end_create_file

copy __createfile c:\temp\unchrome.bat
Updated on 2013-01-24T18:44:48Z at 2013-01-24T18:44:48Z by jeremylam
  • jeremylam
    jeremylam
    2 Posts
    ACCEPTED ANSWER

    Re: Obtaining the values of specific registry keys to a batch file.

    ‏2013-01-24T18:44:48Z  in response to SystemAdmin
    In actions, you need to escape relevance statements with braces for them to be evaluated:

    
    appendfile until __END__ appendfile exists file 
    "C:\autoexec.bat" appendfile 
    {exists file 
    "C:\autoexec.bat"
    } __END__
    


    will create the following file:

    
    exists file 
    "C:\autoexec.bat" 
    
    true