Run Program to del(ete) a file.

Got a problem you cannot solve? Try here.
Post Reply
nico.lammers
Posts: 13
Joined: Wed Jun 03, 2009 10:45 am

Run Program to del(ete) a file.

Post 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..
neillans
Posts: 536
Joined: Sat Nov 04, 2006 6:21 am
Location: Scottish Borders, UK

Post 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.
Andy Neillans
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Post by bokkie »

Nico, take a look at http://www.installaware.com/forums/view ... os+command. Does that help explain the behavior you observed?
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
nico.lammers
Posts: 13
Joined: Wed Jun 03, 2009 10:45 am

Post 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 :)
Post Reply