Avatar of eaweb
eawebFlag for undefined

asked on 

ASP IN BATCH OR COMMAND LINE

hi,

i want to to call a asp file from a batch file. i know that calling a php file is possible with:
CALL C:\PHPFILE.PHP
AND FROM THE COMMAND LINE WITH:
C:\PHP PHPFILE.PHP

how can i do this if i want to execute a asp file?
Scripting LanguagesWeb ApplicationsMicrosoft DOS

Avatar of undefined
Last Comment
eaweb
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Use Windows scripting host and not an ASP page but a VBS file.
Avatar of SteveGTR
SteveGTR
Flag of United States of America image

On my system I'd say:

"c:\Program Files\Internet Explorer\IEXPLORE.EXE" www.someaspfile.asp

Good Luck,
Steve
Avatar of sirbounty
sirbounty
Flag of United States of America image

or you can try

Start c:\pathtofile\yourfile.asp
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

I may be wrong here but I though that ASP is just server side isn't it so you need a web server to talk to?  In which case you'd have to install IIS, say, and then
START http://localhost/yourfile.asp
or
IEXPLORE http://localhost/yourfile.asp

both of which would run on the web server... having said that by default ASP pages are written in VBScript I thought which as leew says you could run directly with wscript or cscript.exe ...

Avatar of SteveGTR
SteveGTR
Flag of United States of America image

It is server side, but you don't need to install IIS on the client if you are referencing a remote server.
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Sorry had completely missed your comment Steve re: using iexplore to a url.
Avatar of eaweb
eaweb
Flag of undefined image

ASKER

hi,

i want to to call a asp file from a batch file. i know that calling a php file from a batch file is possible with:
CALL C:\PHPFILE.PHP

AND FROM THE COMMAND LINE WITH:
C:\>PHP PHPFILE.PHP

how can i do this if i want to execute a asp file?
can i call a asp file from a batch file like with php; if yes how?

ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

But the ASP file has to run on the IIS server and while this will startup IE it will not know how to deal with an ASP file so it will not run locally unless you run a local IIS server and run it with start http://localhost/yourfile.asp like I suggested before.  ASP is Active Server Pages which runs on the server.

The difference with PHP is you can install PHP so that you can run PHP programs locally too.

Steve
Avatar of sirbounty
sirbounty
Flag of United States of America image

If you're wanting to display it though, the above should load it in the browser.
If you're wanting to edit it and don't have any web server software to do so, use

start notepad c:\pathtotfile\yourfile.asp
Avatar of eaweb
eaweb
Flag of undefined image

ASKER

i converted my script in a vbs and made a call from a batch with:

cscript ReplaceAllSetup.vbs
Scripting Languages
Scripting Languages

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.

30K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo