how can i copy a file in my project resources to a temp directory using C#
i have install.bat file in my project resources folder i want to copy this into c:\ directory
You can easily copy resources from an existing resource or executable file to your current resource file. To copy resources, you open both files containing resources at the same time and drag items from one file to another or copy and paste between the two files.
Right-click the resource file into which you'd like to paste the resource (for example, Source2.rc) and choose Paste. To avoid conflicts with symbol names or values in the existing file, Visual C++ may change the transferred resource's symbol value or symbol name and value when you copy it to the new file.
This method works for resource script (.rc) files and resource template (.rct) files, and as executable (.exe) files. Visual C++ includes sample resource files that you can use in your own application.
In Resource View right-click the node of the resource script (.rc) file to which you want to add a resource and select Import. Locate and choose the file name of the bitmap (.bmp), icon (.ico), cursor (.cur), html file (.htm), or other file to import.
My project can copy a dll as resource in a directory, maybe this wil work for you:
File.WriteAllBytes(@"C:\filename.extension", Properties.Resources.install);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With