batch file does not work in Windows7 Ultimate

Dell / DIMENSION 2400
June 12, 2011 at 10:38:25
Specs: Windows 7 home premium, i7-860
Running an i7-860 machine with 8 gigs of memory and Windows 7 Ultimate.

Just switched over from Windows XP Pro, and one of my batch files does not work. When I download a txt file from the internet that does not have the .txt extention on it, I normally run this batch file. It worked great on XP but not on Win7:

I get an error message in the dos window in Win7 that states:

C:\Data >E:\X\new\ftpdown
'E:\X\new\ftpdown' is not recognized as an internal or external command, operable program or batch file.

The batch file:

::== addtxt
@echo off
setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%a in ('dir/s/b/a-d e:\x\new\*.') do (
ren %%a %%~Na.txt

See More: batch file does not work in Windows7 Ultimate

Report •

June 12, 2011 at 12:23:51
From your post the batch file seems to be named addtxt.bat while you run ftpdown. Are you sure ftpdown.bat exists in E.\X\new?

Report •

June 12, 2011 at 15:39:50
ftpdown is part of the folder path, and the addtxt ( I really don' know what that is, except that I think it's part of the batch command ).

The program that I run is called ext.bat

Fortunately I got it working by moving the ext.bat file to the root directory of drive E.

But thank you for the response !

Report •

June 12, 2011 at 16:03:21
Perhaps it was space or ampersand issue.

ren "%%~a" "%%~Na.txt"

Report •

Related Solutions

Ask Question