views:

34

answers:

1

I have yet another subtle problem on Windows :(

The following one-line perl script doesn't work:

perl -e "system('regedit.exe /s C:\my.reg');"

It really runs regedit.exe tool (I'm sure since I tried to run it w/o "/s" and saw confirmation dialogs), but it doesn't create a key in the registry.

I tried to run regedit.exe /s C:\my.reg in from windows shell (cmd.exe) and it works fine.

The original command works fine on Windows XP, but doesn't work on 2008 server. So I suspect that this is system-related issue.

+1  A: 

Are you executing this with an elevated cmd prompt (i.e. admin privileges)? Regedit requires this.

nithins