What are the equivalent commands in Windows if I have these commands in Linux?
if (!is_dir('geoip')) mkdir('geoip', 0744);
shell_exec('unzip -oj GeoLiteCity.zip -d geoip/');
shell_exec('rm -rf geoip/');
|
|
You should download and install GnuWin32 to get all the basic UNIX commands on Windows, for example, http://sourceforge.net/projects/getgnuwin32/files/latest/download?source=files |
||||
|
if you can afford to just ignore errors, then the following would work for your PHP commands: (Hopefully you've got a statement prior to this putting your process in the proper subdirectory BEFORE you do this... like this)
If geoip already exists, the mkdir will return an error, but it's not fatal. Of course, if you unzip something on top of something pre-existing, you've got issues. But your original script doesn't cover that either. rmdir /S /Q geoip/ will remove the subdir geoip and anything below it. same as rm -rf BE CAREFUL with rmdir /S /Q, you can do stupid things with it quite easily. |
|||||||||
|
script.bat
Usage
|
|||
|
|