Still got problems running a VB Script

D

Duncan Edment

I have a VB script that is run in my startup group, to start yENC
decoding in various NGs. The VB script itself is as follows:

' Start yProxy script

' Create shell object
Set WshShell = WScript.CreateObject("WScript.Shell")

' Easynews Server
WshShell.Run("C:\Program Files\yproxy\yProxy.exe
/address:news.easynews.com /rport:119 /lport:119")

' Freeserve Normal server
WshShell.Run("C:\Program Files\yproxy\yProxy.exe
/address:news.freeserve.com /rport:119 /lport:118")

Everything used to work fine, until recently when I started to get the
following error when the script is run:

Windows Script Host

Script: C:\Program Files\yProxy\Start yEnc.vbs
Line: 7
Char: 1
Error: The system cannot find the file specified
Code: 80070002
Source: (null)

As far as I can see, Line 7 is the one that starts "WshShell.Run(" but I
can't figure out what is wrong with it. As I say, it used to work OK.
If I copy and paste the line into the Run box--missing out the
WshShell.Run--it works OK.

Mark L Ferguson suggested:

"VBScript uses a run command with no parens.

shell.run "mycommand""

However, whrn I remove the parens, I still get the same error.

Any ideas, anyone?

Duncan
--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

To e-mail, please remove NO_SPAM.
 
M

Mark L. Ferguson

"Error: The system cannot find the file specified"

Go to start/run, and type: "C:\Program Files\yproxy\yProxy.exe /address:news.freeserve.com /rport:119 /lport:118"

Do a search for yProxy.exe If found, change to the correct path, if not, reinstall yEnc
 
D

Duncan Edment

Mark,

Using Start/Run works, and is what I have to do to get the program
working.

The correct path is "C:\Program Files\yproxy\yProxy.exe", which is what
I have and I have just re-installed it. Still, it does not work.

Any other ideas?

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

To e-mail, please remove NO_SPAM.
 
M

Mark L. Ferguson

You have some typo, or file corruption in that text. I don't see it. Except for the parens, there is nothing wrong with the code I
am seeing on line 7.
-e.g.---
WshShell.Run "cmd /K CD c:\ & DIR"
 
D

Duncan Edment

Mark,

Believe me, I a have typed & re-typed the line. I have checked &
re-checked the spelling. Everything is OK.

However, still it does not work. It used to work. But now it doesn't.
Nothing has changed. I haven't altered the script file or anything, but
now it refuses to work.

Duncan
--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

To e-mail, please remove NO_SPAM.
 
D

Duncan Edment

Ramesh,

Tried your suggestion, but I still get the same error message, on the
same line.

WshShell.Run fName,1, True

There is just something about this line that it doesn't like, but I
don't know what.

Any ideas?

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

To e-mail, please remove NO_SPAM.
 
D

Duncan Edment

Sorry for the delay Mark.

I've tried to run several other Script files and all run OK.

I've re-installed Windows Script host, but still this one script fails
to run.

Any other ideas?

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

To e-mail, please remove NO_SPAM.
 
M

Mark L. Ferguson

Perhaps you have installed MSantispyware, which can block vbscript, or perhaps you need a wait of some kind
....
wscript.sleep "60000" 'wait a minute
....

You might consider running a bat file which runs the proxy, from the vbscript file

--mygo.vbs--
....
shell.run "mybat.bat"
....
 
D

Duncan Edment

Mark,

I have MS AntiSpyware installed and ZoneLabs ZoneAlarm. However, with
both of these, the script I am referring to has been authorised and
enabled.

The "sleep" option made no difference.

I tried it from a batch file, as you suggested. This time, my script
file looks like this:

' Start yProxy script

' Create shell object
Set WshShell = WScript.CreateObject("wscript.Shell")

WshShell.Run("C:\Program Files\yproxy\Start yEnc.bat")

However, when I run it, I get the message:

Script: C:\Program Files\yproxy\Start yEnc.vbs
Line: 6
Char: 1
Error: The system cannot find the file specified.
Code: 80070002
Source: (null)


This time, I can only assume it is referring to the line:

WshShell.Run("C:\Program Files\yproxy\Start yEnc.bat")

And I can confirm, that this is the correct, valid path for the .bat
file.

It just plain refuses to work.

Help!!!!!

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.
 
D

David Candy

One would expect that message with your code. The path has spaces in it and is not enclosed in quotes (the quotes you have are for vb not shell.run).

So

chr(34) is a quote character.

chr(34) & "C:\somewhere\someprogram.exe" & Chr(34) =
"C:\somewhere\someprogram.exe" passed to run

You are passing
C:\somewhere\someprogram.exe
 
D

David Candy

You should have posted the code to begin with.

--
----------------------------------------------------------
http://www.microscum.com/mscommunity/
"David Candy" <.> wrote in message One would expect that message with your code. The path has spaces in it and is not enclosed in quotes (the quotes you have are for vb not shell.run).

So

chr(34) is a quote character.

chr(34) & "C:\somewhere\someprogram.exe" & Chr(34) =
"C:\somewhere\someprogram.exe" passed to run

You are passing
C:\somewhere\someprogram.exe
 
D

Duncan Edment

Sorry David, you're not making any sense. I did post the code of the
VBS file in my original post.

Secondly, the VBS file used to work, as it is written in the original
message. Then, it just refused to work.

Duncan

--
Newsgroups are like one big sandbox that all of us
UseNet kiddies play in with peace & harmony.

Spammers, Cross-Posters, and Lamers are the
people that pee in our big sandbox.

To e-mail, please remove NO_SPAM.
"David Candy" <.> wrote in message
You should have posted the code to begin with.

--
----------------------------------------------------------
http://www.microscum.com/mscommunity/
"David Candy" <.> wrote in message
One would expect that message with your code. The path has spaces in it
and is not enclosed in quotes (the quotes you have are for vb not
shell.run).

So

chr(34) is a quote character.

chr(34) & "C:\somewhere\someprogram.exe" & Chr(34) =
"C:\somewhere\someprogram.exe" passed to run

You are passing
C:\somewhere\someprogram.exe
 
M

Mark L. Ferguson

Well, I don't know what's going on either. Some bug in the antispyware.

I did find the syntax that works, but I have no idea why the correct string no longer works.

set sh=createobject("wscript.shell")
sh.run "file:///C:/Program%20Files/hi.vbs"

The strange thing is that I put both the script and the target exe (hi) in the same folder, and they run, so it's some Long Filename
error


..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top