paul_gilowey
asked on
Using WININIT.INI to move files in use
In Win95 I need to overwrite an exe file which is in use
with a newer version of the file. I enter the appropriate
line into the wininit.ini file eg. c:\destination\mylongfilen ame.exe=c: \temp\mylo ngfilename .exe
This does not work, since the file has a long file name. If I use a short file name, it does work. If I put the path and long file names in quotes, it still does not work.
Any ideas?
with a newer version of the file. I enter the appropriate
line into the wininit.ini file eg. c:\destination\mylongfilen
This does not work, since the file has a long file name. If I use a short file name, it does work. If I put the path and long file names in quotes, it still does not work.
Any ideas?
I had found a way, I have to retrieve it.
ASKER
Adjusted points to 60
Does putting quotes around it work
"c:\destination\mylongfile name.exe"= "c:\temp\m ylongfilen ame.exe"
"c:\destination\mylongfile
ASKER
Thank-you, but no I've tried that already. When I reboot windows, it gives me the message that it is updating my files, but does'nt. All it does is rename the wininit.ini to wininit.bak.
Since the files get copied before windows loads (ie. in DOS
mode) I guess one needs to use the short file name. I tested
to see how windows deals with this, by coping a file with a
long file name via the dos prompt, and then checking in explorer if it kept the long file name ( copy myfile~1.txt \temp\myfile~1.txt). Windows retained the long file name.
No other suggestions?
Since the files get copied before windows loads (ie. in DOS
mode) I guess one needs to use the short file name. I tested
to see how windows deals with this, by coping a file with a
long file name via the dos prompt, and then checking in explorer if it kept the long file name ( copy myfile~1.txt \temp\myfile~1.txt). Windows retained the long file name.
No other suggestions?
Directly from the KB.
Moving Files in Windows 95
Windows 95 does not implement MoveFileEx(), but does provide an alternate way for all Win32-based, 16-bit Windows-based, and MS-DOS-based applications to move, replace, or delete files (but not directories) that are currently in use. This capability is implemented through the [rename] section of a file named Wininit.ini. If Wininit.ini is present in the Windows directory, Wininit.exe processes it when the system boots. Once Wininit.ini has been processed, Wininit.exe renames it to Wininit.bak.
The syntax of the [rename] section is:
DestinationFileName=Source FileName
DestinationFileName and SourceFileName must reside on the same volume and be short (8.3) file names because Wininit.ini is processed before the protected mode disk system is loaded, and long file names are only available when the protected mode disk system is running. Destination and source files specified in Wininit.ini with long file names are ignored.
Moving Files in Windows 95
Windows 95 does not implement MoveFileEx(), but does provide an alternate way for all Win32-based, 16-bit Windows-based, and MS-DOS-based applications to move, replace, or delete files (but not directories) that are currently in use. This capability is implemented through the [rename] section of a file named Wininit.ini. If Wininit.ini is present in the Windows directory, Wininit.exe processes it when the system boots. Once Wininit.ini has been processed, Wininit.exe renames it to Wininit.bak.
The syntax of the [rename] section is:
DestinationFileName=Source
DestinationFileName and SourceFileName must reside on the same volume and be short (8.3) file names because Wininit.ini is processed before the protected mode disk system is loaded, and long file names are only available when the protected mode disk system is running. Destination and source files specified in Wininit.ini with long file names are ignored.
ASKER
I know how to do it. The problem is that when the file gets copied, it loses it's long file name, since I refrence the
short file name.
short file name.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER