scripting - My automatic phonegap installer needs jdk download with wget, I have it working in command prompt but not in .hta file -
i have written vbscript based .hta installer install phonegap/cordova automatically pre-requisites(ant/jdk/bada sdk etc). done stuck @ part need download jdk directly.
if copy paste (long) line in commandprompt , works
wget --header "cookie: gpw_e24=http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html;" ""http://download.oracle.com/otn-pub/java/jdk/7u17-b02/jdk-7u17-windows-i586.exe -o jdk.exe
it download jdk directly , absolutely fine .
when paste code snippet in notepad e.g , save .vbs , run doesnt work
set objshell = createobject("wscript.shell") objshell.currentdirectory = "c:\" 'inquotes function puts quotes around command parameters objshell.run inquotes(workingdir & "\wget.exe") & " " & " --header " & inquotes("cookie: gpw_e24=http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html; ") & "http://download.oracle.com/otn-pub/java/jdk/7u17-b02/jdk-7u17-windows-i586.exe" & " -o" & " " & inquotes("jdk.exe"),1,true function inquotes(toquote) 'return quotes around toquote parameter inquotes = chr(34) & toquote & chr(34) end function
somewhere in teh objshell.run line there problem , wget isn't downloading jdk ... appreciate thank :)
is variable workingdir
defined? if put 1 echo:
strcmd = inquotes(workingdir & "\wget.exe") & " " & " --header " _ & inquotes("cookie: gpw_e24=http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html; ") _ & "http://download.oracle.com/otn-pub/java/jdk/7u17-b02/jdk-7u17-windows-i586.exe" & " -o" & " " & inquotes("jdk.exe") wscript.echo strcmd
i this:
"\wget.exe" --header "cookie: gpw_e24=http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html; "http://download.oracle.com/otn-pub/java/jdk/7u17-b02/jdk-7u17-windows-i586.exe -o "jdk.exe"
and not pass original command. maybe s'd this?
strcmd = "wget.exe --header " _ & inquotes("cookie: gpw_e24=http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html;") _ & " " & chr(34) &chr(34) & "http://download.oracle.com/otn-pub/java/jdk/7u17-b02/jdk-7u17-windows-i586.exe" _ & " -o jdk.exe" wscript.echo strcmd
Comments
Post a Comment