I am trying to install 7-Zip if its already not installed in my Win7 systems using a Perl script.
# Check if 7-Zip is installed or Not.
if (!(-e "C:\\Program Files\\7-Zip")){
print "\n 7-Zip is not installed. Downloading ... \n"
system("wget http://downloads.sourceforge.net/project/sevenzip/7-Zip/9.20/7z920.exe?r=&ts=1392082197&use_mirror=softlayer-dal");
print "\n Installing.. \n";
system("7z920.exe /S /D=\"C:\Program Files\7-Zip\"");
}
It is downloading the file I need (7z920.exe) to the PWD, but it doesn't install. I keep getting the command line error, "Access Denied". Even if I run the script in Administrator mode on command line.
In fact, if I simply go the system path were 7z920.exe on command line and attempt to call the .EXE, i get the same denied error. It won't install. But if I click on it from the folder, it allows me to install it?! Why is that I may double-click and install from folder, but cannot call the executable from the same path from command line and not install it?
C:\>7z920.exe /S /D="C:\Program Files\7-Zip"
Access is denied.
Can you help me? How do I install this using my script? or from a batch file?