Link to home
Start Free TrialLog in
Avatar of rutgermons
rutgermons

asked on

There is no script engine for the file extension ".cmd"

folks, getting error when invoking the below script

There is no script engine for the file extension ".cmd"


@echo off
net stop IBMWAS70Service- AppServer_1
CALL wscript "F:\A_IBMX64\IBM\maximo\deployment\buildear.cmd"
CALL wscript "F:\A_IBMX64\IBMsync.cmd"
net start IBMWAS70Service-AppServer_1

any ideas? or an alternative solution to invoking the above from a windows server?
ASKER CERTIFIED SOLUTION
Avatar of becraig
becraig
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
cmd.exe runs .cmd files equivalent to .bat files
Both Cscript and Wscript expect VBScript files.
Which was my suspicion so you can either run your file as indicated above or:

@echo off
net stop IBMWAS70Service- AppServer_1
CALL cmd.exe /c  "F:\A_IBMX64\IBM\maximo\deployment\buildear.cmd"
CALL  cmd.exe /c "F:\A_IBMX64\IBMsync.cmd"
net start IBMWAS70Service-AppServer_1
Just CALL <other>.cmd will do just fine:

@echo off
net stop IBMWAS70Service-AppServer_1
CALL "F:\A_IBMX64\IBM\maximo\deployment\buildear.cmd"
CALL "F:\A_IBMX64\IBMsync.cmd"
net start IBMWAS70Service-AppServer_1

Open in new window

Note you have a error in your net stop command:

net stop IBMWAS70Service- AppServer_1

(a space after the dash -> you need to remove that space )
Avatar of telczj9
telczj9

What is the error you are getting?

What is the OS version?
Avatar of rutgermons

ASKER

wouldnt this be an option?

@echo off
set BuildearDir=F:\A_IBMX64\maximo\deployment
set SyncWebsphereDir=F:\A_IBMX64
net stop IBMWAS70Service-AppServer_1
CALL "%BuildearDir%\buildear.cmd"
CALL "%SyncWebsphereDir%\IBMsync.cmd"
net start IBMWAS70Service-AppServer_1
Anything that calls the actual cmd file without wscript, (which is what your initial issue was)

If you call the .cmd file with full path or setting the dir as a param would more or less be the same.
Did my comment :

@echo off
net stop IBMWAS70Service- AppServer_1
CALL "F:\A_IBMX64\IBM\maximo\deployment\buildear.cmd"
CALL "F:\A_IBMX64\IBMsync.cmd"
net start IBMWAS70Service-AppServer_1

Resolve this for you, or are you still having issues  ?
I've requested that this question be closed as follows:

Accepted answer: 0 points for rutgermons's comment #a40026149

for the following reason:

i was able to solve the problem myself
This issue was fixed with the first comment.
#40026018

A subsequent question was open based on the information here where rutgermons added the additional step of changing the execution path.

The solution was the removal of wscript from the command and this was clearly indicated even accepted as can be seen in the thread.