473,587 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Use of javascript/Jscript at Win32 DOS prompt


The following DOS prompt command line, in a Win98 DOS box,

cscript //nologo ~tmp.js

executes file ~tmp.js as javascript/Jscript.
The following batch file, similarly run, executes the same.

@echo off
echo WScript.Echo(ne w Date().toUTCStr ing()); > ~tmp.js
cscript //nologo ~tmp.js | STOW GMT
del ~tmp.js

( STOW is a program of mine; the (first line of the) standard output of
cscript is stored in environment variable GMT, in DOS..Win98/ME but
not NT-type systems. )
Such scripts are presumably on-topic here. They will differ from Web-
type scripts in the matter of I/O and controls. They add features to
batch file use, because javascript can do much more than pure Batch; it
can, for example, get GMT.
(a) ISTM worth mentioning this in the FAQ, as it opens a door that might
not previously have been noticed and which has much on the other side.

(b) What is there to say about differences of DOM-type? Differences in
I/O? Use of wscript?

(c) Are any good references known, dealing with the above and not too
much else?

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk DOS 3.3, 6.20; Win98. ©
Web <URL:http://www.merlyn.demo n.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demo n.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demo n.co.uk/batfiles.htm> - also batprogs.htm.
Jul 20 '05 #1
7 2891


Dr John Stockton wrote:
The following DOS prompt command line, in a Win98 DOS box,

cscript //nologo ~tmp.js

executes file ~tmp.js as javascript/Jscript.
You do not even need the command line, double clicking the file should
run it with wscript.
And of course Windows Script Host for some years now also has some XML
format for .wsf files which allow you to include different library files
etc.
Such scripts are presumably on-topic here.
I don't mind anyone asking questions about JScript programs for Windows
Script Host here but I think that groups like
microsoft.publi c.scripting.wsh
provide more expertise on Windows Script host. Admittedly WSH groups
postings are more often dealing with VBScript programming than JScript
programming but the object model is the same. And there are jscript
scripting groups on the Microsoft server that deal with Windows Script
Host programming too.

(a) ISTM worth mentioning this in the FAQ, as it opens a door that might
not previously have been noticed and which has much on the other side.
Windows Script Host is mentioned in the FAQ as one of the common hosts.
The HTML version of the FAQ is even created by a .wsf file.

(c) Are any good references known, dealing with the above and not too
much else?


Well, the MS scripting documentation documents the Windows Script Host
object model, file format etc:
http://msdn.microsoft.com/library/de...ist/webdev.asp

Of course that is not all that is possible, once you are outside of the
security restrictions of the browser you can instantiate everything from
ADODB objects for doing data base stuff to Word.Applicatio n and script it.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
JRS: In article <3f********@ola f.komtel.net>, seen in
news:comp.lang. javascript, Martin Honnen <ma*******@yaho o.de> posted at
Sun, 21 Dec 2003 19:41:43 :-
Dr John Stockton wrote:
The following DOS prompt command line, in a Win98 DOS box,

cscript //nologo ~tmp.js

executes file ~tmp.js as javascript/Jscript.
You do not even need the command line, double clicking the file should
run it with wscript.


Not when working at a DOS prompt. I had in mind including that in a DOS
batch file, as I showed below.

And of course Windows Script Host for some years now also has some XML
format for .wsf files which allow you to include different library files
etc.
Such scripts are presumably on-topic here.


I don't mind anyone asking questions about JScript programs for Windows
Script Host here but I think that groups like
microsoft.publi c.scripting.wsh
provide more expertise on Windows Script host. Admittedly WSH groups
postings are more often dealing with VBScript programming than JScript
programming but the object model is the same. And there are jscript
scripting groups on the Microsoft server that deal with Windows Script
Host programming too.


AFAICS, they in practice refer at least predominantly and AFAIR almost
wholly to VBscript (when using WSH) or to use in Web pages.

(a) ISTM worth mentioning this in the FAQ, as it opens a door that might
not previously have been noticed and which has much on the other side.


Windows Script Host is mentioned in the FAQ as one of the common hosts.
The HTML version of the FAQ is even created by a .wsf file.


Mentioned rather in passing, though, and unlikely to be noticed by the
unaware.

(c) Are any good references known, dealing with the above and not too
much else?


Well, the MS scripting documentation documents the Windows Script Host
object model, file format etc:
http://msdn.microsoft.com/library/de...ist/webdev.asp


MS references are rarely good for those with an intermittent Net
connection. They have rather few information bits per byte transferred.
I believe that an entry in Section 4 of the FAQ would be worthwhile;
just illustrating starting javascript-in-WSH from the command line and
from, say, File Manager & Internet Explorer, and giving a well-chosen
link or two.

It could include
<script type="text/javascript" src="include1.j s"></script>
&
<script type="text/javascript">
...
</script><noscrip t> ... </noscript>
- they may be strictly HTML, but they are important to Web use of
javascript, and often given wrongly in the group.

Perhaps a possible <FAQENTRY> could be composed here, if Jim would like
to use such.


The FAQ has not been updated lately, and new expertise has come into the
group. Might it be worth jointly reviewing one numbered part here each
week, starting I suggest at 3.1 and working round to 2.12 then 3.1
again?

Re 3.1 - I find the Pocket Reference Flanagan very useful; it is cheaper
& smaller.

Re 3.2 - Nothing to say about the intent, but I'd prefer <p> instead of
<BR> before each subsubsection.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 20 '05 #3


Dr John Stockton wrote:
JRS: In article <3f********@ola f.komtel.net>, seen in
news:comp.lang. javascript, Martin Honnen <ma*******@yaho o.de> posted at
Sun, 21 Dec 2003 19:41:43 :-

Dr John Stockton wrote:
(c) Are any good references known, dealing with the above and not too
much else?


Well, the MS scripting documentation documents the Windows Script Host
object model, file format etc:
http://msdn.microsoft.com/library/de...ist/webdev.asp

MS references are rarely good for those with an intermittent Net
connection. They have rather few information bits per byte transferred.


You can download the docs at the posted link, no need to visit them online.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #4
On Sun, 21 Dec 2003 19:41:43 +0100, Martin Honnen <ma*******@yaho o.de>
wrote:
(c) Are any good references known, dealing with the above and not too
much else?


Well, the MS scripting documentation documents the Windows Script Host
object model, file format etc:
http://msdn.microsoft.com/library/de...ist/webdev.asp


Also from the FAQ, and not worth duplicating the info of:

Sites focused on using Scripting to automate Windows:
http://www.windows-script.com/
http://cwashington.netreach.net/

Although it may be worth while altering the text along with those
urls.

Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #5
JRS: In article <3f************ ***@news.cis.df n.de>, seen in
news:comp.lang. javascript, Jim Ley <ji*@jibbering. com> posted at Tue, 23
Dec 2003 12:51:06 :-
Also from the FAQ, and not worth duplicating the info of:

Sites focused on using Scripting to automate Windows:
http://www.windows-script.com/
http://cwashington.netreach.net/

Although it may be worth while altering the text along with those
urls.


Thanks, I will look at those. Yes, the words could be changed; much of
the time, I consider Windows as merely an environment for running
several DOS boxes in and for providing better-looking editors.

Presuming applicable, something with the words MSDOS & Batch might be
added?

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
HOLS.HTM <--> HOLIDAYS.HTM JS-VALID READS USER RULES (demo; w. eval)
Jul 20 '05 #6
JRS: In article <0i************ **@merlyn.demon .co.uk>, seen in
news:comp.lang. javascript, Dr John Stockton <sp**@merlyn.de mon.co.uk>
posted at Tue, 23 Dec 2003 20:06:09 :-
JRS: In article <3f************ ***@news.cis.df n.de>, seen in
news:comp.lang .javascript, Jim Ley <ji*@jibbering. com> posted at Tue, 23
Dec 2003 12:51:06 :-
Also from the FAQ, and not worth duplicating the info of:

Sites focused on using Scripting to automate Windows:
http://www.windows-script.com/
http://cwashington.netreach.net/

Although it may be worth while altering the text along with those
urls.


Thanks, I will look at those. Yes, the words could be changed; much of
the time, I consider Windows as merely an environment for running
several DOS boxes in and for providing better-looking editors.

Presuming applicable, something with the words MSDOS & Batch might be
added?


One is a Microsoft site, (now?) masquerading under a false identity; the
other is a sort of newsgroup, and very slow. Neither is what I would
like to find under that heading, although it is certainly a valid
description of that pair.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 20 '05 #7
Martin Honnen wrote:
Dr John Stockton wrote:
[...] Martin Honnen <ma*******@yaho o.de> wrote:
Well, the MS scripting documentation documents the Windows Script Host
object model, file format etc:
http://msdn.microsoft.com/library/de...ist/webdev.asp
MS references are rarely good for those with an intermittent Net
connection. They have rather few information bits per byte transferred.


You can download the docs at the posted link,


Alas, you cannot.

| Microsoft Windows Script 5.6 Documentation
|
<http://www.microsoft.c om/downloads/details.aspx?Fa milyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&di splaylang=en>
| This download provides extensive reference and conceptual
| documentation for all of Microsoft Windows Script Technologies.
| Date: September 12, 2001

Following the link results in:

| RTSP/1.0 400 Bad Request
| Server: QTSS-Akamai/4.1 (Build/412.16; Platform/Linux)
| Cseq:
| Connection: Close

Reproducible.
no need to visit them online.


I would be glad if it were the case.
PointedEars
Jul 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8205
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2347
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.