How to use batch processing to run the latest executable file in a directory? Ignoring subdirectories, without using third-party tools, and the file names have no pattern, ^_^ Let's see how everyone implements it
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!
@echo off
for /f "delims=" %%a in ('dir /od/b *.exe') do set name="%%a"
%name%
Originally posted by yishanju at 2007-3-12 14:42:
^_^
dir /o:d is correct, or dir /o/d
Originally posted by yishanju at 2007-3-12 14:59:
^_^ Remember a question, if you put this batch file into the directory of the executable program to be run, then this batch file becomes the latest file in the directory
This should cause an infinite loop