1
0
mirror of https://github.com/solemnwarning/ipxwrapper synced 2024-12-30 16:45:37 +01:00

Use correct syntax to delete registry keys on NT.

This commit is contained in:
Daniel Collins 2024-11-03 16:10:37 +00:00
parent ce8d9be9ca
commit bc4ebfef2f

View File

@ -155,15 +155,20 @@ sub reg_delete_value
{
my ($host_ip, $key, $value) = @_;
eval { run_remote_cmd($host_ip, "REG", "QUERY", "$key\\$value"); };
unless($@)
if(IPXWrapper::Tool::OSVersion->get($host_ip)->platform_is_winnt())
{
if(IPXWrapper::Tool::OSVersion->get($host_ip)->platform_is_winnt())
eval { run_remote_cmd($host_ip, "REG", "QUERY", $key, "/v", $value); };
unless($@)
{
run_remote_cmd($host_ip, "REG", "DELETE", $key, "/v", $value, "/f");
}
else{
}
else{
eval { run_remote_cmd($host_ip, "REG", "QUERY", "$key\\$value"); };
unless($@)
{
run_remote_cmd($host_ip, "REG", "DELETE", "$key\\$value", "/FORCE");
}
}