captsnappy
Programmer
VFP9 built-to-exe running on Windows 2003 Terminal Server.
Program copies files for users. When an existing target file found (same filename), it attempts to delete target file, then copy new file to target folder.
On my development XP machine the file deletion works but not on the Terminal Server. The existing target file does not get deleted. These are graphic files. Previewing them reveals that the existing target file does get overwritten.
I have tried these variations of commands to delete the file - some found on this forum:
They all delete the file on the XP dev machine but not on the Terminal server.
On the terminal server if I drag-and-drop, or copy-paste via Windows Explorer all is good, the files get overwritten.
I can not believe that this is becoming an issue with my program! Seems like a super simple function, ha.
Any suggestions will be most appreciated.
Program copies files for users. When an existing target file found (same filename), it attempts to delete target file, then copy new file to target folder.
On my development XP machine the file deletion works but not on the Terminal Server. The existing target file does not get deleted. These are graphic files. Previewing them reveals that the existing target file does get overwritten.
I have tried these variations of commands to delete the file - some found on this forum:
Code:
if fexist(gcsavefile) && fexist is function to replace the VFP file()
* one pf these variations
* variation 1 delete file (gcsavefile)
* variation 2 ccmdline = "del "+ gcsavefile
* variation 2 ! &ccmdline
* variation 3 MyCommand = "del " + gcsavefile
* variation 3 LOCAL lcCmd, loShell
* variation 3 lcCmd = GETENV("ComSpec") + [ /C ] + MyCommand
* variation 3 loShell = CREATEOBJECT("wscript.shell")
* variation 3 = loShell.Run(lcCmd,0,.t.)
* variation 3 * 0 to hide display, .t. to wait for completion
copy file (thisform.ccorlogf) to (gcSaveFile)
endif
They all delete the file on the XP dev machine but not on the Terminal server.
On the terminal server if I drag-and-drop, or copy-paste via Windows Explorer all is good, the files get overwritten.
I can not believe that this is becoming an issue with my program! Seems like a super simple function, ha.
Any suggestions will be most appreciated.