doskey support in "Execute Windows batch command" option.

234 views
Skip to first unread message

Ankit Singhal

unread,
Apr 10, 2015, 11:52:37 PM4/10/15
to jenkins...@googlegroups.com
Hi All

We have build script which sets a doskey for certain commands. 

Jenkins somehow is  not able to recognize doskey:

Problem is easily reproducible,

Script: foo.bat
====================
doskey d=dir

=======================

Jenkins : Execute Windows batch command

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

call foo.bat
d

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Failure output

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Code\workspace\Windows-Trunk\src>call foo.bat 

C:\Code\workspace\Windows-Trunk\src>doskey d=dir 

C:\Code\workspace\Windows-Trunk\src>d
'd' is not recognized as an internal or external command,
operable program or batch file.

C:\Code\workspace\Windows-Trunk\src>exit 9009 
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Any idea why?

Regards
Ankit

Ankit Singhal

unread,
Apr 12, 2015, 1:59:25 AM4/12/15
to jenkins...@googlegroups.com
Anyone??

corneil....@gmail.com

unread,
Apr 12, 2015, 2:46:16 AM4/12/15
to jenkins...@googlegroups.com
AFAIK Jenkins will created a temporary batch file from the 'Execute Windows Commands' and just execute that and check the error level afterwards. The output is captured and becomes part of the build output. 
I don't think it is a matter of Jenkins recognizing the command.

Create a batch file with same commands and execute on command prompt to see the result. 

Anyone??
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f2a29605-dbc6-45d9-8d0a-22eb5dfb6949%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Richard Bywater

unread,
Apr 12, 2015, 3:19:48 AM4/12/15
to jenkins...@googlegroups.com
According to http://ss64.com/nt/doskey.html , "You cannot run a Doskey macro from a batch file"

I'm guessing it is because Doskey works with the command interpreter level which presumably isn't available in batch files.

Richard.

--
Reply all
Reply to author
Forward
0 new messages