1.

Solve : Suppress file name extensions -- MS DOS?

Answer»

Hi,

I have a directory in which i will get one zip file every day. It can be any type of the zip file and I don't know the name of the file (i.e., the file name varies every day). But i will know what type of the zip file it is (for ex, *.zip, *.bz2, *.7Z ETC).

on getting this zip file, I have to load the name of this zip file into a separate file and i have to create a new directory with this name (with no extension).

I have used one simple command "dir /B *.zip > dir_file.txt". But this is giving the file name with extensions. IF any one gives me any addition to this command it will solve my problem.

Or you can give me ENTIRE new command to do this task. Can ANYONE help me how to do this in DOS?I am presuming that you don't really mean "MS-DOS" but rather Windows NT family command language (Windows 2000 and later).

At the prompt:

for %A in (*.zip) do echo %~nA > dir_file.txt

In a batch file:

for %%A in (*.zip) do echo %%~nA > dir_file.txt

Hi Salmon,

Your presumption is right.  i meant that only.
and your logic is also USEFUL for me. Thanks for the help.



Discussion

No Comment Found