Problems using WScript to execute a batch file 
Author Message
 Problems using WScript to execute a batch file

Hello  I am new to WScript so I am sure this is a simple queston.  I am
currently using ASP to generate a bat file on the fly then want to use
WScript to launch the bat file.  The problem I am having is that while the
bat file runs without error nothing happens (the bat file itself generates a
file if I manually run it) unless I am in Visual Interdev debug mode on the
server.  If I launch visual interdev to debug the page then it works fine
after setting the server up to debug asp pages even from other machines
calling the web page!  I am pretty sure that visual interdev is configuring
the server so that the WScript shell command is allowed to execute.  This is
a LAN solution so security is not a high priority (I am not worried about
people running malicious scripts).  I am currently running IIS 4/NT Server 4
sp 3/Visual Interdev 6.0 and have given the WWW service permission to
interact with the desktop.  HELP! as this has been a show stopper for two
days now!!!

--
Jon Kenoyer
Online Training Solutions Inc

425-885-1441 ext. 33

"...two kinds of people:
 those who want to go work for a company to make it successful,
and those who want to go work for a successful company."
Jamie Zawinski
http://www.*-*-*.com/



Tue, 26 Feb 2002 03:00:00 GMT  
 Problems using WScript to execute a batch file
...
Obj.Run '%comspec% /c c:\mybat.bat'
...

--
mvp Mark L. Ferguson Please reply in newsgroup
marfers notes for OE 5 > (16K) http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm

Quote:

> Hello  I am new to WScript so I am sure this is a simple queston.  I am
> currently using ASP to generate a bat file on the fly then want to use
> WScript to launch the bat file.  The problem I am having is that while the
> bat file runs without error nothing happens (the bat file itself generates a
> file if I manually run it) unless I am in Visual Interdev debug mode on the
> server.  If I launch visual interdev to debug the page then it works fine
> after setting the server up to debug asp pages even from other machines
> calling the web page!  I am pretty sure that visual interdev is configuring
> the server so that the WScript shell command is allowed to execute.  This is
> a LAN solution so security is not a high priority (I am not worried about
> people running malicious scripts).  I am currently running IIS 4/NT Server 4
> sp 3/Visual Interdev 6.0 and have given the WWW service permission to
> interact with the desktop.  HELP! as this has been a show stopper for two
> days now!!!

> --
> Jon Kenoyer
> Online Training Solutions Inc

> 425-885-1441 ext. 33

> "...two kinds of people:
>  those who want to go work for a company to make it successful,
> and those who want to go work for a successful company."
> Jamie Zawinski
> http://www.jwz.org/gruntle/nomo.html



Tue, 26 Feb 2002 03:00:00 GMT  
 Problems using WScript to execute a batch file
Mark,
      I also need to try to get a batch file or even the actual program run
from a script.  Would prefer to have the program executed from the script.
Problem that I have encountered is not being able to pass the arguments that
the program needs to it.  Can you show me a way of doing this.
Jon


...
Obj.Run '%comspec% /c c:\mybat.bat'
...

--
mvp Mark L. Ferguson Please reply in newsgroup
marfers notes for OE 5 > (16K)
http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm


Quote:
> Hello  I am new to WScript so I am sure this is a simple queston.  I am
> currently using ASP to generate a bat file on the fly then want to use
> WScript to launch the bat file.  The problem I am having is that while the
> bat file runs without error nothing happens (the bat file itself generates
a
> file if I manually run it) unless I am in Visual Interdev debug mode on
the
> server.  If I launch visual interdev to debug the page then it works fine
> after setting the server up to debug asp pages even from other machines
> calling the web page!  I am pretty sure that visual interdev is
configuring
> the server so that the WScript shell command is allowed to execute.  This
is
> a LAN solution so security is not a high priority (I am not worried about
> people running malicious scripts).  I am currently running IIS 4/NT Server
4
> sp 3/Visual Interdev 6.0 and have given the WWW service permission to
> interact with the desktop.  HELP! as this has been a show stopper for two
> days now!!!

> --
> Jon Kenoyer
> Online Training Solutions Inc

> 425-885-1441 ext. 33

> "...two kinds of people:
>  those who want to go work for a company to make it successful,
> and those who want to go work for a successful company."
> Jamie Zawinski
> http://www.jwz.org/gruntle/nomo.html



Mon, 11 Mar 2002 03:00:00 GMT  
 Problems using WScript to execute a batch file

Take a look at this old post (attached)

Running it or with a batch file from there should be easy.

--
mvp Mark L. Ferguson Please reply in newsgroup
marfers notes for OE 5 > (16K)
http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm


Quote:
> Mark,
>       I also need to try to get a batch file or even the actual
program run
> from a script.  Would prefer to have the program executed from the
script.
> Problem that I have encountered is not being able to pass the
arguments that
> the program needs to it.  Can you show me a way of doing this.
> Jon


> ...
> Obj.Run '%comspec% /c c:\mybat.bat'

[ Attached Message ]

From:
To:
Date: Mon, 26 Jul 1999 20:01:18 -0400
Local: Mon, Jul 26 1999 8:01 pm
Subject: Re: How do you pass script variables to dos?
If I am reading you right, this would be a way to pass variables into a
script in DOS.  Just run with cscript mytest.vbs arg1 arg2  You can get
more fancy if you want with error checking.

*****************mytest.vbs*************************************
Set Argc = Wscript.Arguments
Set Argv = Wscript.Arguments

If Argc.Count Then  ' If greater than one then do this.
        Select Case Argc.Item(0)
                Case "Var1" WSHShell.Popup Argc.Item(0) & sMsg, 1,
"Notice", 64
                Case "Var2" WSHShell.Popup Argc.Item(1) & sMsg, 1,
"Notice", 64
        End Select
Else ' No args found
        On Error Resume Next
        Err.Raise 1  ' Raise an overflow error.
        Wscript.Echo "No variable found"
        Err.Clear    ' Clear the error
        Wscript.Quit()
End If
************************************************************************
****
*********



- Show quoted text -

Quote:
> I am just getting started with scripting and would like to use a very
basic
> script to add the username on a 95/98 workstation logging into a NT
Server
> to a variable and then run a batch file that would be able to use that
> variable.
> I can get the username and display it with the script, but how do you
make
> the variable accessable to dos?

> Thanks for any help,

> George Rose



Thu, 14 Mar 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. how to execute a batch file into a VBS file

2. Executing a *.vbs script using wscript.shell on a *.asp page

3. wscript cant find .vbs file from NT logon batch

4. wscript cant find .vbs file from NT logon batch

5. Wscript.quit and ErrorLevel on 9x batch file

6. How to execute a batch file within a vbscript or activeX ftp object

7. Executing Batch Files

8. Executing batch files

9. Execute a batch file

10. Executing a batch file from a VBS.

11. Executing a Batch File on another Computer

12. Executing batch files from Web Page

 

 
Powered by phpBB® Forum Software