Windows Script Host Version 5.8

Windows 7 Enterprise not Activating 0xC004F038 (more than 25 machines) Starting to rollout windows 7 enterprise across the site. Finished the image and getting activation problems on all clients.

Active21 days ago

I have a shortcut with 'target' 'C:UsersPublicTestProTestPro Automation Frameworktaf.js'.

Windows Script Host Version 5.8

I want to run that from a batch file so I copied the 'C:UsersPublicTestProTestPro Automation Frameworktaf.js' into cmd.exe command line and pressed enter. Nothing happened.

How can I run 'C:UsersPublicTestProTestPro Automation Frameworktaf.js' from a command line on Windows7?

update

the js file contains

I tried to run the js file with both Wscript.exe and Cscript.exe as @Serge suggested but nothing worked = the program I start by doubleclicking hasn't started. No error either.

Radek
RadekRadek
1,45917 gold badges44 silver badges74 bronze badges

3 Answers

You have two options:

or

The former one starts the command line version of Windows Scripting Host and the latter one is starting the window version.

Windows Script Host Version 5.812

The command line options are documented here:https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cscript

and here:https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/wscript

In your script file you should use the full path to your jar file and possibly full path to the java.exe

Alternatively, to allow the java.exe locate the tar-loader.jar file you should change the current directory to the one containing this file, so before invoking wscript make cd 'C:UsersPublicTestProTestPro Automation Framework'

As you mentioned that you like to run this script in a single touch, you also may create a shortcut on your desktop that has a command line set to Wscript.exe 'C:UsersPublicTestProTestPro Automation Frameworktaf.js' and working directory set to C:UsersPublicTestProTestPro Automation Framework

Community
SergeSerge

If you can run 'java' in a console window with no errors, then

1) Create a text file on your desktop called 'taf.txt'

2) Enter 'java -Dlog.dir=%TEMP% -jar taf-loader.jar' into the text file, and save it

3) Rename the file to 'taf.bat'

Done.

Using a scripting host to start a script which launches a shell that launches a java program is just too long winded.

Windows script host version 5.812

Think of it in terms of what you want to achieve - you want the program to launch with a click of an icon.

The batch file is the fastest way to achieve that on win7.

If you were using an OS that could natively kick off a Javascript script with no messing about it would be a nice way to launch it, but that script wouldn't work on anything other than windows (unless ActiveX is ported now - been a long time since I've used it).

Source: Professional Java Developer for over 10 years

AlexAlex

Java 1.6 comes with jrunscript to run JavaScript outside of web browsers.

Jens Erat
13.4k11 gold badges47 silver badges61 bronze badges
Umapathy RavichandiranUmapathy Ravichandiran

Not the answer you're looking for? Browse other questions tagged windows-7command-line or ask your own question.

Windows Script Host Version 5.8 Download

  1. Copyright (C) Microsoft Corporation. All rights reserved.
  2. Executing dd if=serial.img of=?DeviceHarddisk2DR13 bs=1024 seek=852327 count=64
  3. Written by John Newbigin <jn@it.swin.edu.au>
  4. This program is covered by terms of the GPL Version 2.
  5. 64+0 records in
  6. Executing dd if=serial.img of=?DeviceHarddisk2DR13 bs=1024 seek=852391 count=64
  7. Written by John Newbigin <jn@it.swin.edu.au>
  8. This program is covered by terms of the GPL Version 2.
  9. 64+0 records in
  10. Executing dd if=turboboot.img of=?DeviceHarddisk2DR13 bs=1024 seek=852455
  11. Written by John Newbigin <jn@it.swin.edu.au>
  12. This program is covered by terms of the GPL Version 2.
  13. Error reading file: 87 The parameter is incorrect
  14. 2293+1 records out
  15. Executing dd if=bravo_update.dat.rdu of=?DeviceHarddisk2DR13 bs=1024 seek=856551
  16. Written by John Newbigin <jn@it.swin.edu.au>
  17. This program is covered by terms of the GPL Version 2.
  18. Error reading file: 87 The parameter is incorrect
  19. 4664+1 records out
  20. Executing dd if=bravo_update.dat of=?DeviceHarddisk2DR13 bs=1024 seek=862000
  21. Written by John Newbigin <jn@it.swin.edu.au>
  22. This program is covered by terms of the GPL Version 2.
  23. Error reading file: 87 The parameter is incorrect
  24. 67339+1 records out
  25. Executing dd if=u-boot.bin of=?DeviceHarddisk2DR13 bs=1024 seek=991719
  26. Written by John Newbigin <jn@it.swin.edu.au>
  27. This program is covered by terms of the GPL Version 2.
  28. 224+0 records in
  29. Executing dd if=u-boot.bin of=?DeviceHarddisk2DR13 bs=1024 seek=991991 count=8
  30. Written by John Newbigin <jn@it.swin.edu.au>
  31. This program is covered by terms of the GPL Version 2.
  32. 8+0 records in
  33. dd if=/dev/zero of=?DeviceHarddisk2DR13 bs=1024 seek=991999 count=1