You can create an automation server for 'Microsoft Scripting Runtime'.FileSystemObject ( if you can't find it,Windows Scripting Host has to be installed) and use the methods supplied.
Are we talking renaming an existing file?
Or creating a file from within Navision.
NewName :='C:\My Files\temp.txt';
OldName := 'C:\temp.txt';
IF EXISTS(OldName)THEN
IF NOT EXISTS(NewName)THEN
RENAME(OldName,NewName)
ELSE
ERROR(NewName+' already Exists')
Is that what you mean?
Replace an Old file with a New file same Name
NewName :='C:\My Files\temp.txt';
OldName := 'C:\temp.txt';
IF EXISTS(OldName)THEN BEGIN
// Delete the destination file first
IF EXISTS(NewName)THEN
ERASE(NewName);
// Move the file
RENAME(OldName,NewName)
END;
Comments
Or creating a file from within Navision.
NewName :='C:\My Files\temp.txt';
OldName := 'C:\temp.txt';
IF EXISTS(OldName)THEN
IF NOT EXISTS(NewName)THEN
RENAME(OldName,NewName)
ELSE
ERROR(NewName+' already Exists')
Is that what you mean?
Replace an Old file with a New file same Name
NewName :='C:\My Files\temp.txt';
OldName := 'C:\temp.txt';
IF EXISTS(OldName)THEN BEGIN
// Delete the destination file first
IF EXISTS(NewName)THEN
ERASE(NewName);
// Move the file
RENAME(OldName,NewName)
END;
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com