Page 1 of 1

Run Program to del(ete) a file.

Posted: Thu Sep 10, 2009 8:38 am
by nico.lammers
I've tried the following script command to delete a file (outside of the MSI install procedure)

Code: Select all

Run Program del "$TARGETDIR$\\temp.bat" (WAIT)
But I found that it didn't work. This line

Code: Select all

Run Program cmd /C "del "$TARGETDIR$\\temp.bat"" (WAIT)
does work, but I was sort of wondering why the first command doesn't do what you'd think it would do..

Posted: Thu Sep 10, 2009 11:39 am
by neillans
Hmm - nothing really without digging into this further, however, I would suggest trying Run Program As -- these two functions use slightly different process creation API's.

Posted: Thu Sep 10, 2009 3:49 pm
by bokkie
Nico, take a look at http://www.installaware.com/forums/view ... os+command. Does that help explain the behavior you observed?

Posted: Thu Sep 10, 2009 4:48 pm
by nico.lammers
bokkie wrote:Nico, take a look at http://www.installaware.com/forums/view ... os+command. Does that help explain the behavior you observed?
Yeah, this seems to be the same things.
I also figured it would be because copy, del etc. are parsed by the command shell.

I needed to add the quotes so I can use paths with spaces in them :)

First thing I tried btw was putting the commands in a batch file, using the Write To Text File (or something) plugin. Which also worked. Only I needed to delete the temporary bacth file after that.. for which I came up with this solution :)

That, and I should learn to check the stickies :)