有位朋友想查询进程的具体文件路径,所以写了以下p处理。
@echo off
for /f "skip=3 tokens=1 delims= " %%a in ('tasklist') do @echo %%a : %%~fa
pause
但是其输出很乱,有没有什么办法控制使其左对齐或右对齐呢 。输出如下:
System : C:\Documents and Settings\ChenYuhua\桌面\System
System : C:\Documents and Settings\ChenYuhua\桌面\System
smss.exe : C:\Documents and Settings\ChenYuhua\桌面\smss.exe
csrss.exe : C:\Documents and Settings\ChenYuhua\桌面\csrss.exe
winlogon.exe : C:\Documents and Settings\ChenYuhua\桌面\winlogon.exe
SERVICES.EXE : C:\Documents and Settings\ChenYuhua\桌面\SERVICES.EXE
LSASS.EXE : C:\Documents and Settings\ChenYuhua\桌面\LSASS.EXE
Ati2evxx.exe : C:\Documents and Settings\ChenYuhua\桌面\Ati2evxx.exe
SVCHOST.EXE : C:\Documents and Settings\ChenYuhua\桌面\SVCHOST.EXE
SVCHOST.EXE : C:\Documents and Settings\ChenYuhua\桌面\SVCHOST.EXE
SVCHOST.EXE : C:\Documents and Settings\ChenYuhua\桌面\SVCHOST.EXE
SVCHOST.EXE : C:\Documents and Settings\ChenYuhua\桌面\SVCHOST.EXE
SVCHOST.EXE : C:\Documents and Settings\ChenYuhua\桌面\SVCHOST.EXE
SPOOLSV.EXE : C:\Documents and Settings\ChenYuhua\桌面\SPOOLSV.EXE
avp.exe : C:\Documents and Settings\ChenYuhua\桌面\avp.exe
Ati2evxx.exe : C:\Documents and Settings\ChenYuhua\桌面\Ati2evxx.exe
EXPLORER.EXE : C:\Documents and Settings\ChenYuhua\桌面\EXPLORER.EXE
avp.exe : C:\Documents and Settings\ChenYuhua\桌面\avp.exe
alg.exe : C:\Documents and Settings\ChenYuhua\桌面\alg.exe
ctfmon.exe : C:\Documents and Settings\ChenYuhua\桌面\ctfmon.exe
Maxthon.exe : C:\Documents and Settings\ChenYuhua\桌面\Maxthon.exe
conime.exe : C:\Documents and Settings\ChenYuhua\桌面\conime.exe
notepad.exe : C:\Documents and Settings\ChenYuhua\桌面\notepad.exe
wmiprvse.exe : C:\Documents and Settings\ChenYuhua\桌面\wmiprvse.exe
cmd.exe : C:\Documents and Settings\ChenYuhua\桌面\cmd.exe
cmd.exe : C:\Documents and Settings\ChenYuhua\桌面\cmd.exe
tasklist.exe : C:\Documents and Settings\ChenYuhua\桌面\tasklist.exe
@echo off
for /f "skip=3 tokens=1 delims= " %%a in ('tasklist') do @echo %%a : %%~fa
pause
但是其输出很乱,有没有什么办法控制使其左对齐或右对齐呢 。输出如下:
System : C:\Documents and Settings\ChenYuhua\桌面\System
System : C:\Documents and Settings\ChenYuhua\桌面\System
smss.exe : C:\Documents and Settings\ChenYuhua\桌面\smss.exe
csrss.exe : C:\Documents and Settings\ChenYuhua\桌面\csrss.exe
winlogon.exe : C:\Documents and Settings\ChenYuhua\桌面\winlogon.exe
SERVICES.EXE : C:\Documents and Settings\ChenYuhua\桌面\SERVICES.EXE
LSASS.EXE : C:\Documents and Settings\ChenYuhua\桌面\LSASS.EXE
Ati2evxx.exe : C:\Documents and Settings\ChenYuhua\桌面\Ati2evxx.exe
SVCHOST.EXE : C:\Documents and Settings\ChenYuhua\桌面\SVCHOST.EXE
SVCHOST.EXE : C:\Documents and Settings\ChenYuhua\桌面\SVCHOST.EXE
SVCHOST.EXE : C:\Documents and Settings\ChenYuhua\桌面\SVCHOST.EXE
SVCHOST.EXE : C:\Documents and Settings\ChenYuhua\桌面\SVCHOST.EXE
SVCHOST.EXE : C:\Documents and Settings\ChenYuhua\桌面\SVCHOST.EXE
SPOOLSV.EXE : C:\Documents and Settings\ChenYuhua\桌面\SPOOLSV.EXE
avp.exe : C:\Documents and Settings\ChenYuhua\桌面\avp.exe
Ati2evxx.exe : C:\Documents and Settings\ChenYuhua\桌面\Ati2evxx.exe
EXPLORER.EXE : C:\Documents and Settings\ChenYuhua\桌面\EXPLORER.EXE
avp.exe : C:\Documents and Settings\ChenYuhua\桌面\avp.exe
alg.exe : C:\Documents and Settings\ChenYuhua\桌面\alg.exe
ctfmon.exe : C:\Documents and Settings\ChenYuhua\桌面\ctfmon.exe
Maxthon.exe : C:\Documents and Settings\ChenYuhua\桌面\Maxthon.exe
conime.exe : C:\Documents and Settings\ChenYuhua\桌面\conime.exe
notepad.exe : C:\Documents and Settings\ChenYuhua\桌面\notepad.exe
wmiprvse.exe : C:\Documents and Settings\ChenYuhua\桌面\wmiprvse.exe
cmd.exe : C:\Documents and Settings\ChenYuhua\桌面\cmd.exe
cmd.exe : C:\Documents and Settings\ChenYuhua\桌面\cmd.exe
tasklist.exe : C:\Documents and Settings\ChenYuhua\桌面\tasklist.exe
