Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"!DIR >file" worked in win98 but not in win2000

Status
Not open for further replies.

ericomaha

Programmer
Apr 19, 2002
2
US
Problem with "! dir *.*>edir.txt" when we switched from win98 machines to win2000 the long filenames disappeared. If you use cmd or command and do it manually, it has the long filenames, but when run inside vfp it returns the old dos 8.3 and no long filenames.
 
In your VFP startup directory, wherever VFP is installed, (Program Files .....) there is a file call FOXRUN.PIF. This is what gets run by using the ! or RUN command. Look at the "Program" setting. You will see COMMAND.COM. Change this to CMD.EXE and you will be set.

Dave S.
 
Another idea, if you can't edit the FoxRun.PIF, is to do this:

RUN CMD /c DIR > edit.txt

Another way, you've probably rejected because it converts everything to uppercase, is, of course, the ADIR() function, but it does support the long file names.

Also, though, you could use the Windows Scripting Host ActiveX component:
oFSO = CREATEOBJ('Scripting.FileSystemObject')
oFold = oFSO.GetFolder('C:\source')
for each oFile in oFold.Files
?oFile.Name
endfor
 
Any reason you don't use ADIR() or SYS(2000)?

Rick
 
Thanks for your responses. Could not find a foxrun.pif file anywhere... maybe why it isn't using the proper command file. This routine started back in FoxPlus and haven't changed anything more than adjusting the database. Looks like the ADIR() command is the way to go on this.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top