Posts tagged ‘batch’

Hide the command console window while running a GUI/Command line program on Windows

While running a command line program or some GUI initiated from command line on Windows, there is always a black console window on the screen. This sometime becomes annoying. For example, when you start the Eric Python IDE on Windows, normally you start it by calling a batch file “eric4.bat” which calls the actual eric4.py script sequentially. Since Eric4 is designed to be a GUI program, the black console window has no use but it is there. To prevent that or hide it, there are several ways. Continue reading ‘Hide the command console window while running a GUI/Command line program on Windows’ »

Get random numbers under BASH and DOS

Both Linux Bash and Windows DOS support random number generation. The random number is ‘stored’ in a system environment variable named “RANDOM” (I believe this variable links to a script to generate the actual random numbers on both systems), use it in the same way as you use other ENV variables.  E.g.

Continue reading ‘Get random numbers under BASH and DOS’ »

Handy ‘which’ command on Windows

VERY handy!

1
2
3
4
5
6
7
8
9
10
 @echo off
rem --------------------------------------------------------
rem File: which.cmd
rem Description: Windows equivalent of Unix which command
rem Author: Pankaj Kumar
rem Copyright 2004 Pankaj Kumar. All Rights Reserved.
rem License: This software is available under GPL (http://www.gnu.org/licenses/gpl.html)
rem ---------------------------------------------------------
setlocal
if "%1" == "" goto noArg

Continue reading ‘Handy ‘which’ command on Windows’ »

Print directory tree on Windows and Linux using tree, sed, awk or Python

Equivalent of “which” in Windows Command Shell Pankaj Kumars Weblog

如果想要知道一个程序或命令在Windows操作系统上的全路径,请使用下面这个脚本,它和Linux的which命令一样。

Continue reading ‘Equivalent of “which” in Windows Command Shell Pankaj Kumars Weblog’ »