Subj : Re: BC++5.02 16bits application and folders To : borland.public.cpp.borlandcpp From : "Sebastian Ledesma" Date : Fri Feb 27 2004 05:14 pm Try this, I used it for an old 16bit that runs with other 32bits apps, some time ago I migrated this application to Win32, but this function should work right now: Saludos Sebastian PS: Sorry for a litle long post. #include #include "longname.h" #include #include #include #define CF 1 int winRename(const char _FAR *oldname, const char _FAR *newname) { #if defined WIN32 return MoveFile(oldname, newname); #else struct REGPACK regs; regs.r_ax = 0x7156; regs.r_ds = FP_SEG(oldname); regs.r_dx = FP_OFF(oldname); regs.r_es = FP_SEG(newname); regs.r_di = FP_OFF(newname); intr(0x21, ®s); if (regs.r_flags & CF) return regs.r_ax; return 0; #endif } BOOL GetDosName(char *longname, char *shortname) { WIN32_FIND_DATA fd; HANDLE hfind; hfind = FindFirstFile(longname, &fd); if (hfind == INVALID_HANDLE_VALUE) return FALSE; if (strlen(fd.cAlternateFileName) > 0) strcpy(shortname, fd.cAlternateFileName); else strcpy(shortname, fd.cFileName); FindClose(hfind); return TRUE; } BOOL GetWindowsName(char *shortname, char *longname) { WIN32_FIND_DATA fd; HANDLE hfind; hfind = FindFirstFile(shortname, &fd); if (hfind == INVALID_HANDLE_VALUE) return FALSE; strcpy(longname, fd.cFileName); FindClose(hfind); return TRUE; } .