Using JavaScript and VBScript scripting to access the windows registry

K

korund

Is there any difference to read & write to windows Registry with
VBScript or JavaScript?
Both scripting languages have similar syntax. What is preferable use
for this?

thanks.
 
V

VK

Is there any difference to read & write to windows Registry with
VBScript or JavaScript?

There is not any. Both languages are not able to do it.

If you are using local (file://) script to access FileSystemObject,
then it is also irrelevant what language to use: JScript or VBScript.
FileSystemObject is not part of neither of both, so its method/property
set is equal.
 
H

Hal Rosser

VK said:
There is not any. Both languages are not able to do it.

If you are using local (file://) script to access FileSystemObject,
then it is also irrelevant what language to use: JScript or VBScript.
FileSystemObject is not part of neither of both, so its method/property
set is equal.

VBScript can access the fileSystemObject - just not *normally* from a web
page.
Remember the "I-Love-You.vbs" virus ?
Put a "vbs" extension on a file with VBScript, and it'll run with a
double-click.
 
R

Richard Cornford

Is there any difference to read & write to windows
Registry with VBScript or JavaScript?

Presumably you are referring to the interfaces to the Windows Registry
provided by Windows Scripting Host. In WSH the host provides the same
object model to whichever scripting language is used; the same objects,
methods, properties, etc.
Both scripting languages have similar syntax.

No they don't.
What is preferable use
for this?

If you only know one of those languages then that one is probably the
best to use. If you know both then whichever you prefer is going to be
the best. And if you know neither VBScript may be best as it is the
language used in the vast majority of examples of WSH scripting.

Richard.
 
K

korund

Richard Cornford пиÑал(а):

(e-mail address removed) wrote:
Is there any difference to read & write to windows
Registry with VBScript or JavaScript?
Presumably you are referring to the interfaces to the Windows Registry
provided by Windows Scripting Host. In WSH the host provides the same
object model to whichever scripting language is used; the same objects,
methods, properties, etc.
Both scripting languages have similar syntax.
No they don't.

What is preferable use for this?
If you only know one of those languages then that one is probably the
best to use. If you know both then whichever you prefer is going to be
the best. And if you know neither VBScript may be best as it is the
language used in the vast majority of examples of WSH scripting.
--------------
When we need use Windows Scripting Host, both languages have almost
similar syntax:

<script language="VBScript">
<!--
Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
....
<script language="javascript">
<!--
var WshShell = WScript.CreateObject("WScript.Shell");
....

The difference only that Javascript have no 'Dim WSHShell' line. Or it
need this also? Also, if we use mostly Javascript for webpage, we can
use Javascript for WSH.

Korund
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top