Solved

Using WININIT.INI to move files in use

Posted on 1998-12-08
8
225 Views
Last Modified: 2013-12-25
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\mylongfilename.exe=c:\temp\mylongfilename.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?
0
Comment
Question by:paul_gilowey
  • 4
  • 3
8 Comments
 

Author Comment

by:paul_gilowey
ID: 1498067
Edited text of question
0
 
LVL 14

Expert Comment

by:waty
ID: 1498068
I had found a way, I have to retrieve it.
0
 

Author Comment

by:paul_gilowey
ID: 1498069
Adjusted points to 60
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1498070
Does putting quotes around it work
"c:\destination\mylongfilename.exe"="c:\temp\mylongfilename.exe"
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:paul_gilowey
ID: 1498071
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?

0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1498072
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=SourceFileName

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.

0
 

Author Comment

by:paul_gilowey
ID: 1498073
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.
 
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 60 total points
ID: 1498074
Yep, that's right. And the text that I gave you came directly from the Microsoft knowledge base describing that it cannot be done.
So the answer to your question is that it cannot be done.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

937 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now