cmd.exe from Cygwin

Lee ler762@gmail.com
Fri Jan 2 14:23:00 GMT 2009


On 1/2/09, Jeenu V <jeenuv@gmail.com> wrote:
> Hi,
>
> I've to run some windows commands repeatedly. Since I'm familiar and
> comfortable with BASH, I thought I would perform the 'intelligent'
> decisions using BASH scripts and run rest using cmd.exe invoked from
> Cygwin bash shell. But this is the problem I face:
>
> The program I intend to run with cmd.exe (with /c switch) fails to run
> as it couldn't access some Windows paths. Please take a look like this
> command, for example:

The backslash is an escape character, so you need to get it treated as
a character somehow - escaping ("\\") or inside quotes works for me:

$ cmd /c c:\util\showdev.bat
'c:utilshowdev.bat' is not recognized as an internal or external command,
operable program or batch file.

$ cmd /c c:\\util\\showdev.bat
C:\cygwin\home\Lee>set devmgr_show_nonpresent_devices=1
C:\cygwin\home\Lee>cd\windows\system32
C:\Windows\System32>start devmgmt.msc

$ cmd /c "c:\util\showdev.bat"
C:\cygwin\home\Lee>set devmgr_show_nonpresent_devices=1
C:\cygwin\home\Lee>cd\windows\system32
C:\Windows\System32>start devmgmt.msc

Regards,
Lee


>
> N:\src\CEDAR\GENERIC\base\bsp\hwip_arm\rvemuboard\ct1136\test>cmd /c
> bldmake bldfiles ARMV6
> sh: E:SymbianM04765_Symbian_OS_v9.5binTechViewepoc32toolsbldmake.bat:
> command not found
>
> There are two things that I'm surprised about:
> 1) How come a command launched from cmd.exe spits an error message
> starting with 'sh:'?
> 2) Why are back-slashes stripped-off from the path in output message?
>
> Also it came to my notice that cmd.exe invoked from a Cygwin bash
> shell doesn't really behave like the Windows cmd.exe. For example, if
> you press up-arrow, the cursor goes flying over the window and the
> display sometimes goes for a toss. Keys like F7 and F8 doesn't work
> either.
>
> It would suffice--as of now, at least--if I could launch a
> cmd.exe--separate and independent--window from a Cygwin shell. I could
> try
>
> explorer.exe c:\windows\system32\cmd.exe
>
> but I'm unable to pass parameters to cmd.exe (say /c or a batch file name).
>
> Please help.
>
> --
> Thanks
> Jeenu
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>
>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list