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

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -