Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #11666
| From | "Mayayana" <mayayana@invalid.nospam> |
|---|---|
| Newsgroups | microsoft.public.scripting.vbscript |
| Subject | Re: WriteLine fails with error 5 (bad argument) on a string ? |
| Date | 2017-04-28 19:16 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <oe0ibf$hg$1@dont-email.me> (permalink) |
| References | (4 earlier) <odrh5j$gd1$1@dont-email.me> <odroca$qnn$1@dont-email.me> <oduioc$ahg$1@dont-email.me> <odvfss$5sa$1@dont-email.me> <oe04jm$hcc$1@dont-email.me> |
"GS" <gs@v.invalid> wrote
You're doing this in VBS? I thought you were using
VB. I've never done it in VBS. There are several parts
here I'm not sure about. I've never needed/used
SetCredentials. You didn't need to adjust the send
header at all? You didn't check the error and I don't
know if you're using https, so that leaves unanswered
questions.
I'm curious why you set the version of winhttp. I
guess it's fine, but won't that limit you if you run
from a machine that has, say, 5.2?
It appears you got a 200 response if you're writing
to disk. So maybe all the above doesn't matter. I'm
not really familiar with ADODB and you've scrunched it
all into a dubious one-liner, so I also don't know how
to troubleshoot that. You realize the return is a byte
array? I don't know what Type 2 is. Hopefully that's
binary.
|
| Set oWHR = CreateObject("WinHttp.WinHttpRequest.5.1")
| oWHR.Open "GET", sSrcFile, False
| ' Use HTTPREQUEST_SETCREDENTIALS_FOR_PROXY if user and password
| ' is for proxy, not for download the file.
| ' objHTTP.SetCredentials "User", "Password",
| HTTPREQUEST_SETCREDENTIALS_FOR_SERVER
| oWHR.Send
|
| If oWHR.Status = 200 Then
| Dim oADO
| Set oADO = CreateObject("ADODB.Stream")
| With oADO
| .Type = 2: .Open: .Write oWHR.ResponseBody: .SaveToFile sTgtFile:
.Close
| End With
| End If
|
| ..which, so far, just creates an empty file. Can you see where something
is
| missing?
|
| --
| Garry
|
| Free usenet access at http://www.eternal-september.org
| Classic VB Users Regroup!
| comp.lang.basic.visual.misc
| microsoft.public.vb.general.discussion
Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
WriteLine fails with error 5 (bad argument) on a string ? "R.Wieser" <address@not.available> - 2017-04-18 14:14 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-18 09:06 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "R.Wieser" <address@not.available> - 2017-04-18 16:44 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-18 18:50 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "R.Wieser" <address@not.available> - 2017-04-19 11:39 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-19 09:22 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "R.Wieser" <address@not.available> - 2017-04-19 17:27 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-19 13:49 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "R.Wieser" <address@not.available> - 2017-04-20 17:56 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-20 13:24 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? Ulrich Möller <knobbi38@arcor.de> - 2017-04-21 01:05 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-20 21:42 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "R.Wieser" <address@not.available> - 2017-04-21 10:11 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? "R.Wieser" <address@not.available> - 2017-04-21 09:23 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-18 09:57 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "R.Wieser" <address@not.available> - 2017-04-18 17:20 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-18 14:27 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "R.Wieser" <address@not.available> - 2017-04-18 22:15 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-18 18:30 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "R.Wieser" <address@not.available> - 2017-04-19 11:09 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-19 09:23 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-19 09:59 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "R.Wieser" <address@not.available> - 2017-04-19 17:41 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-18 11:58 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-26 09:56 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "R.Wieser" <address@not.available> - 2017-04-26 16:35 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-26 10:44 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-26 11:07 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-26 16:29 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-26 21:26 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-26 23:28 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-28 01:11 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-28 09:28 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-28 15:22 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-28 19:16 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-28 22:08 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-28 22:11 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-28 22:17 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-28 22:21 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-28 22:37 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-29 00:01 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-29 01:19 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-29 01:46 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-29 12:36 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-29 19:59 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-29 20:18 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-28 23:50 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-28 19:29 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-28 22:04 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? "Mayayana" <mayayana@invalid.nospam> - 2017-04-28 22:25 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? GS <gs@v.invalid> - 2017-04-28 22:31 -0400
Re: WriteLine fails with error 5 (bad argument) on a string ? Ulrich Möller <knobbi38@arcor.de> - 2017-04-18 19:20 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? "R.Wieser" <address@not.available> - 2017-04-18 19:58 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? Ulrich Möller <knobbi38@arcor.de> - 2017-04-19 14:59 +0200
Re: WriteLine fails with error 5 (bad argument) on a string ? "R.Wieser" <address@not.available> - 2017-04-19 16:46 +0200
csiph-web