Using jscript for logon script

A

Andrew

I have written a jscript that is executed when the user logs into the
network. Among other things, I want the script to be able to run an
executable which is stored on the network. Can anyone tell me the proper
syntax for this? I think the line, WshShell.Run, is to be used but unsure
of how it would be written.

Thank You
 
A

Andrew

I used x.Run(\\\\server\\share\\filename);

This works fine, however, I also need to pass some parameters encased in
double quotes. The above statement doesn't allow more than the two already
used. This is the statement I am trying to call accross the network:

\\server\share\filename "\\server\share\filename -
s -f1\\server\share\filename -f2\c:filename"

When I use the above in a .bat file it works great. The problem is finding
the right syntax to do the same thing in a .js file

Any help would be appreciated...sorry about double posting. I didn't
realize there was this group at first.
 
M

Michael Harris \(MVP\)

I used x.Run(\\\\server\\share\\filename);
This works fine, however, I also need to pass some parameters encased
in double quotes. The above statement doesn't allow more than the
two already used. This is the statement I am trying to call accross
the network:

\\server\share\filename "\\server\share\filename -
s -f1\\server\share\filename -f2\c:filename"

When I use the above in a .bat file it works great. The problem is
finding the right syntax to do the same thing in a .js file

You can just use single quotes to enclose a string literal that includes
double quotes as in:

'this thing "that thing"'

So that would mean (all on one line)...

x.Run('\\\\server\\share\\filename
"\\\\server\\share\\filename -s -f1\\\\server\\share\\filename -f2
c:filename"');

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US

Technet Script Center
http://www.microsoft.com/technet/scriptcenter/default.asp

Microsoft® Windows®2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top