Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-04-27
12
Medium Priority
?
1,353 Views
Last Modified: 2014-05-10
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?
0
Comment
Question by:rutgermons
12 Comments
 
LVL 29

Accepted Solution

by:
becraig earned 2000 total points
ID: 40026018
Try removing the wscript and simply call the cmd file, I am not sure if wscript handles cmd files.


@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
0
 
LVL 84

Expert Comment

by:David Johnson, CD, MVP
ID: 40026029
cmd.exe runs .cmd files equivalent to .bat files
0
 
LVL 46

Expert Comment

by:aikimark
ID: 40026062
Both Cscript and Wscript expect VBScript files.
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 29

Expert Comment

by:becraig
ID: 40026068
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
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 40026078
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 )
0
 
LVL 3

Expert Comment

by:telczj9
ID: 40026118
What is the error you are getting?

What is the OS version?
0
 

Author Comment

by:rutgermons
ID: 40026149
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
0
 
LVL 29

Expert Comment

by:becraig
ID: 40026150
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.
0
 
LVL 29

Expert Comment

by:becraig
ID: 40026257
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  ?
0
 

Author Comment

by:rutgermons
ID: 40039402
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
0
 
LVL 29

Expert Comment

by:becraig
ID: 40039403
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.
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
A procedure for exporting installed hotfix details of remote computers using powershell
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question