Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: FileCopy SDK 1008
FileCopy("\\cosmos\share\winstall\nalinstl\nalexp\nalexp32.dll", "d:\winnt\system32", @FALSE)I thought that this command would do an automatic overwrite without asking for user input?
if FileExist("mytarget.txt") == 2 then Message("Ah-ha!!", "File is Open in Read-Deny Mode")
In this case, to do a delayed file move, you may want to investigate...
IntControl(30...in the WIL help file.
Or use IntControl 5 to control whether system and hidden files or directories are seen and processed.
This may be due to file caching.
The solution is to do a FileDelete of the target file before performing the copy.
Swap out the network card on that PC.
To further diagnose a network card failure....
Find some whopping big file on the workstation. Excel.exe usually works. Using Explorer copy the file to the network server. Copy the file back to the PC with a different name. Compare source and destination files (fcomp?) (FileCompare) and see if they are the same or not.
Before, I was able to copy a file onto itself. For example, I start the program MyProgram.exe on a workstation. If a newer version of the program exists on the server, the newer program was then copied in the same directory as the older program, hence overwriting the older program. It worked great for updates.
But now, this does not work. If I rename the program MyProgram.exe to something else and run it, the new version will copy just fine. (I'm using FALSE for overwrite warning).
Was there a change that does not allow FileCopy to overwrite a file that's in use or is open? If it was a "bug" in the previous version of the compiler it sure was a nice bug for us :-)
Now in WinBatch 16 bit land, if you were not running the *required* share.exe file in your autoexec.bat, then anything was possible)
PSS ID Number: Q145935
4.00
WINDOWS
-------------------------------------------------------
- Microsoft Win32 Software Development Kit for
Microsoft Windows 95
-------------------------------------------------------
SYMPTOMS
The CopyFile function fails and GetLastError returns ERROR_ACCESS_DENIED
when you try to copy a read-only file to a core SMB server (such as a LAN
Manager for UNIX server) or to a Netware server when the client computer
uses real-mode network drivers. The destination file is created as a
read-only file and is zero in length.
CAUSE
This error message occurs because there is a mismatch between the way that
the Windows 95 redirector accesses files and the way that these servers
expect this access.
RESOLUTION
Remove the read-only attribute before calling the CopyFile function to
allow the file to be copied correctly. After the copy is complete, then
the read-only attribute can be restored.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. We are researching this problem and will
post new information here in the Microsoft Knowledge Base as it becomes
available.
Additional reference words: 4.00
KBCategory: kbprg kbbuglist
KBSubcategory: BseFileio
==============================================
Article last modified on 04-10-1996
The information in this article applies to:
========
=====
==========
======
Copyright Microsoft Corporation 1996.
Article ID: W13063
Filename: FileCopy Failure.txt
File Created: 2002:05:30:14:29:40
Last Updated: 2002:05:30:14:29:40