Why Does Output of This Command to a File Work Differently Inside a .BAT Script? -


wmic process name,processid,commandline >> test2.txt 

works dandy cmd.exe. however, not work .bat script (no output file changed or generated). echo output reads follows:

wmic process name,processid,commandline  1>>test2.txt 

what "1" doing there? reflection of handle? why work differently , how can address it?

the 1 number of file descriptor you're redirecting. if leave out file descriptor in redirection, 1 (stdout) implicitly assumed. more information see here.

as command, it's working fine me both in batch file , directly in cmd.


Comments

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -