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.
I have a shortcut with 'target' 'C:UsersPublicTestProTestPro Automation Frameworktaf.js'
.
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.
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
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.
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
Java 1.6 comes with jrunscript
to run JavaScript outside of web browsers.
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
- Copyright (C) Microsoft Corporation. All rights reserved.
- Executing dd if=serial.img of=?DeviceHarddisk2DR13 bs=1024 seek=852327 count=64
- Written by John Newbigin <jn@it.swin.edu.au>
- This program is covered by terms of the GPL Version 2.
- 64+0 records in
- Executing dd if=serial.img of=?DeviceHarddisk2DR13 bs=1024 seek=852391 count=64
- Written by John Newbigin <jn@it.swin.edu.au>
- This program is covered by terms of the GPL Version 2.
- 64+0 records in
- Executing dd if=turboboot.img of=?DeviceHarddisk2DR13 bs=1024 seek=852455
- Written by John Newbigin <jn@it.swin.edu.au>
- This program is covered by terms of the GPL Version 2.
- Error reading file: 87 The parameter is incorrect
- 2293+1 records out
- Executing dd if=bravo_update.dat.rdu of=?DeviceHarddisk2DR13 bs=1024 seek=856551
- Written by John Newbigin <jn@it.swin.edu.au>
- This program is covered by terms of the GPL Version 2.
- Error reading file: 87 The parameter is incorrect
- 4664+1 records out
- Executing dd if=bravo_update.dat of=?DeviceHarddisk2DR13 bs=1024 seek=862000
- Written by John Newbigin <jn@it.swin.edu.au>
- This program is covered by terms of the GPL Version 2.
- Error reading file: 87 The parameter is incorrect
- 67339+1 records out
- Executing dd if=u-boot.bin of=?DeviceHarddisk2DR13 bs=1024 seek=991719
- Written by John Newbigin <jn@it.swin.edu.au>
- This program is covered by terms of the GPL Version 2.
- 224+0 records in
- Executing dd if=u-boot.bin of=?DeviceHarddisk2DR13 bs=1024 seek=991991 count=8
- Written by John Newbigin <jn@it.swin.edu.au>
- This program is covered by terms of the GPL Version 2.
- 8+0 records in
- dd if=/dev/zero of=?DeviceHarddisk2DR13 bs=1024 seek=991999 count=1