Page 1 of 1

Need some help with VBS pre-queue script

Posted: May 15th, 2012, 2:37 pm
by ErikBrown
Hi,

As a test I tried the below pre-queue VBS script. It works fine if I run it in a command window but when I configure it as the pre-queue script in SABnzbd (070B5 on Windows XP SP3) then it results in the following error:

Image

Line 16 points to the line : objStdOut.WriteLine "1"

The script is as follows:

dim NZBname
dim NZBcategory
dim NewNZBname
dim Args

args = WScript.Arguments.Count
If args < 3 then WScript.Quit

NZBname = WScript.Arguments.Item(0)
NZBcategory = WScript.Arguments.Item(2)
NewNZBname = NZBname

if NewNZBname <> "" then
Set objStdOut = WScript.StdOut
objStdOut.WriteLine "1"
objStdOut.WriteLine NewNZBname
objStdOut.close
end if

Any idea why this results in this error?

Erik

Re: Need some help with VBS pre-queue script

Posted: May 15th, 2012, 10:53 pm
by J03 8LACK
ErikBrown,

In Short,
change all your WScript.StdOut.WriteLine's to WScript.Echo.

or change line 15 from Set objStdOut = WScript.StdOut to Set objStdOut = WScript.Echo

Why? Check out here - http://www.tech-archive.net/Archive/Scr ... /0979.html

Just helping out
J03