File help

This is a discussion on File help within the Windows Programming forums, part of the Platform Specific Boards category; Hi all. My goal here is to copy the currently used file. Then start the new file and delete the ...

Im stumped trying to figure this out. Any suggestions will be accepted (as long as their helpful =P). I think its trying to delete itself, which is 'not' what im trying to do. So if anyone can help me figure out what im doing wrong i'd be very greatful. Thanx in advance!

when the strings are C strings will not work - a constant and an argv[] string will NEVER have the same address, and that's what you are comparing.

If that doesn't help, try some printf's to indicate what's in each of your strings, and follow what happens.

Also, check the status of CopyFile() and ShellExecute()- If this fails, you probably want to "do something about it" - not sure exactly what, but you certainly shouldn't exit the current app if ShellExecute fails!