Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add to a windows DIR 1

Status
Not open for further replies.

skinah

Programmer
Oct 3, 2001
17
AU
What I want to do is delete a file that is off the windows directory. I know how to delete a file and how to getwindowsdirectory, but how do I combine the two ??

SAy the file is c:\windows\temp\test.tmp

How do I add two strings together or write a line that assigns both strings.

deletefile(LPwindir, "\\temp\\test.tmp");

is there a way of writting it this way ? I would prefer two strings that way the code is more reusable.


thanks for any tips or source code.
 
Simple way:

char buff[256];
GetWindowsDirectory(buff,256);
strcat(buff,"\\temp\\test.tmp");
DeleteFile(buff); :) Hope that this helped! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top