Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
Credits 114 Posts 49 Joined 2006-10-08 06:47 19-year member UID 64907
Status Offline
This code displays messages like "Device not ready", "File not found" when running. How to hide these messages? I added >NUL in several places but got errors.
for %%a in (Z Y X W V U T S R Q P O N M L K J I H G F E D C) do for /f "delims=" %%b in ('dir /s/b/a %%a:\AVP.EXE 2^>NUL') do if exist "%%b" set xt=%%a:
for /f "usebackq delims=/" %%i in (`dir /s/a-d/b %xt%\AVP.EXE 2^>NUL`) do set aa_dir=%%~dpi
cd /d %aa_dir%
[ Last edited by bd540 on 2007-10-11 at 02:28 AM ]
Credits 1,928 Posts 931 Joined 2007-01-06 11:46 19-year member UID 75624 Gender Male
Status Offline
@echo off
for %%a in (Z Y X W V U T S R Q P O N M L K J I H G F E D C) do (
dir /a /b /s "%%a:\avp.exe">nul 2>nul
if not errorlevel 1 for /f "delims=" %%i in ('dir /a /b /s "%%a:\avp.exe"') do start "" "%%~dpi"
)
pause
Credits 114 Posts 49 Joined 2006-10-08 06:47 19-year member UID 64907
Status Offline
Originally posted by wudixin96 at 2007-10-10 15:12:
@echo off
for %%a in (Z Y X W V U T S R Q P O N M L K J I H G F E D C) do (
dir /a /b /s "%%a:\avp.exe">nul 2>nul
if not errorlevel 1 for /f "delims=" %%i in ('dir ...
Credits 114 Posts 49 Joined 2006-10-08 06:47 19-year member UID 64907
Status Offline
Originally posted by wudixin96 at 2007-10-10 17:51:
How did you write it??
:P I'm not very familiar with DOS, and I'm not familiar with some basic commands. The above code was still pieced together by searching the forum, so please give me the complete command :D