vbscript - Unzip a password protected file in vbsript -


i facing trouble here,could please tell me how unzip password protected field in vbscript? have code runs perfectly,but asking password each time when runs

pathtozipfile="c:\folder.zip"  extractto="c:\"  set sa = createobject("shell.application")  set filesinzip=sa.namespace(pathtozipfile).items  sa.namespace(extractto).copyhere(filesinzip) 

i need code not ask password in run,please help,thank you!!

afaik shell.application object doesn't support providing password. try 7-zip instead:

pass    = "..." zipfile = "your.zip"  createobject("wscript.shell").run "7za.exe x -p" & pass & " " & zipfile, 0, true 

if necessary add path 7za.exe and/or file.zip. if path contains spaces, you'll need put double quotes around it, e.g. this:

function qq(str) : qq = chr(34) & str & chr(34) : end function  zipfile = qq("c:\path\with spaces\to\your.zip") 

Comments

  1. this is ridiculous, you are not unzipping the file using vbs, you are unzipping using 7z, lamer

    ReplyDelete

Post a Comment

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -