I need to update some configuration files on users PCs now and then, and I want to do it automatically. In the past I've created temporary .bat files and executed them with open(). Now I'm trying to use runprogram to do the same thing but it's not working. I think I'm almost there - any help is greatly appreciated.
Here's my program:
old_file = "C:\some directory\file1.ext";
new_file = "Z:\zdrive folder\file1.ext";
d1 = last modification date(old_file);
d2 = last modification date(new_file);
if (d1 != d1,
options_list = evallist({"copy", "/y", evalinsert("\["^new_file^"]\"), evalinsert("\["^old_file^"]\")});
status = runprogram(executable("cmd.exe"), options(options_list), readfunction("text"));
);
If the dates are not identical it puts double quotes around each filename path and executes a copy/y in a DOS shell. I'm running Windows 7 btw. I ran the string in a DOS window and it copied the file no problem.