Copy (Move) DosFiles (OpenInsight 32-bit Specific)
At 08 DEC 2010 07:22:14PM Terry Rainville wrote:
I dont see a command for MOVING dos files and I dont think I can use the old format of 'SUSPEND EXIT MOVE' in OI.
If there is a MOVE procedure for dosfiles in OI please let me know.
So I am instead doing it in 2 parts
CopyOsFile
OsDelete
Problem - the target file is a mapped (shared) drive on another computer, for some reason the CopyOsFile is failing.
I checked the command using MOVE at dos prompt and it works so I have rights to the shared directory.
Does anyone know why this would not be working properly.
At 08 DEC 2010 07:39PM Terry Rainville wrote:
CopyOsFile - does not support wildcard characters - you must supply the target filename.
Now does anyone know anything about a moveing function.
Or does it still need to be done in 2 parts.
At 08 DEC 2010 11:44PM Barry Stevens wrote:
Isnt there something somewhere(forum) that tells you how to do it like shellexecute open cmd 'move x to y'
At 09 DEC 2010 12:02AM Barry Stevens wrote:
fount it.
rtrn=Utility("RUNWIN","cmd /c XCOPY C:\JUNK\*.* D:\JUNK\*.* /S/V/E")
At 09 DEC 2010 11:03AM Warren Auyong wrote:
Use OLE and the scripting.FileSystemObject
fsO=OLEcreateInstance( 'Scripting.FileSystemObject')
result=OleCallMethod(fsO,'MoveFile',fromfile, tofile)
http://msdn.microsoft.com/en-us/library/z9ty6h50%28VS.85%29.aspx
At 09 DEC 2010 04:43PM Barry Stevens wrote:
Bookmarking that one, I had thought I had seen something like that here. Cool
At 09 DEC 2010 10:59PM Warren Auyong wrote:
Be aware that if the target file exists it will not be overwritten.
Wild cards may be used to specify the source files or "\\" as the folder/directory.
Since this works at the OS level then if the target is on the same drive the files are not physically moved - just the directory tables are updated. File time/date stamps are also left intact which is not the case with CopyOSFile which I suspect does an OSREAD/OSWRITE. This is based on the observation of the amount of disk activity and that the time/date stamps are modified. Files can be renamed at the time of moving them by specifying a different name as the target.
Using RUNWIN/Shellexecute fails more often than not due to the size limitation of CMD buffer or the need for quotes due to spaces in folder/file names.