Link to home
Start Free TrialLog in
Avatar of eteran
eteranFlag for United States of America

asked on

AUto unzip .vbs task 2003 sever

I created a batch file .vbs to run the below posted script. It is not working any clues

unzip -do "C:\Documents and Settings\main\Local Settings\Temporary Internet Files\Content.IE5\AD2JQOZH\s_data[1].zip" -d "C:\MLSDATA\"

Avatar of Farhan Kazi
Farhan Kazi
Flag of Australia image

>> I created a batch file .vbs
Windows batch file should have .cmd or .bat extensions NOT vbs.
One more thing... I don't see any "-do" switch in UnZip.exe help. I think it should be only "-o"  that is overwrite files WITHOUT prompting.
Avatar of eteran

ASKER

Renamed the file to a .cmd. Can you please explain the diffrence between .cmd, .bat and .vbs please. When I run the script dos opens up and diplays the script endless in the dos window. What do I have wroung here

unzip -o "C:\Documents and Settings\root\Local Settings\Temporary Internet Files\Content.IE5\AD2JQOZH\s_data[1].zip" -d "C:\MLSDATA\"

Both .cmd and .bat are DOS scripts they can include Windows internal & external commands. BAT extensions are executed in a 16bit VDM (mean executed by the old 16-bit command processor) while .CMD extensions are executed in a 32bit (executed by the new 32-bit cmd processor) VDM. This has implications for scripts that may need to access shared memory from other processes or applications.
(The CMD extension is limited to newer Windows systems and is not recognized in Windows 9x/Me systems.)

The batch files (.cmd or .bat) are relatively simple to follow, but the VBScript files require some explanation to understand how they work together. If you already know Visual Basic or Visual Basic for Applications, VBScript will be very familiar. Even if you don't know Visual Basic, once you learn VBScript, you're on your way to programming with the whole family of Visual Basic languages.

:: Unzip does not process files with special characters (like [ ]).
:: Unzip also dislikes long path
:: So first make Temp folder on C: drive
:: Try this:

Copy /Y "C:\Documents and Settings\root\Local Settings\Temporary Internet Files\Content.IE5\AD2JQOZH\s_data[1].zip"  C:\Temp\s_data.zip

UnZip.exe -o "C:\Temp\s_data.zip" -d "C:\MLSDATA\"

Hope this helps!
Farhan
Avatar of eteran

ASKER

Okay so do I do a batch cmd or vbs file with what we are tlaking about.
.cmd batch file.
Avatar of eteran

ASKER

Trying this code but nothing moves. any Idea. the s_data.zip file is that in that directory doser that matter.

Copy /Y "C:\Documents and Settings\root\Local Settings\Temporary Internet Files\Content.IE5\AD2JQOZH\s_data[1].zip"  C:\Temp\s_data.zip
ASKER CERTIFIED SOLUTION
Avatar of Farhan Kazi
Farhan Kazi
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of eteran

ASKER

oKAY GOT IT TO WORK
Avatar of eteran

ASKER

Now I have to do the unzip
Any update?