copy to output directory file delete - wpf

i find that to play video files using mediaelement, we need to set the file's Copy To Ouput Directory to Copy Always. is there any option to auto delete the file from the output directory after it has been used? because if there's hundreds of video that has been played by the application, then it will take a massive amount of storage, right? because from what i seen, this copy to ouput directory will create the duplicate of the files, from it's original source path. please enlighten me

You do not need to copy the files to the output directory, you can set the source as follows:
mediaElement.Source = new Uri (System.IO.Path.Combine(dirWithVids, fileName)
,UriKind.RelativeOrAbsolute)

Related

How to look at the contents of a zipped folder in batch?

In this case, I have a zip folder with contents inside. How would I look into the zip folder and be able to check the file name of those files for a certain word without having to unzip the file to begin with?
So for example:
I have a zip folder with the files inside named
123456789COW.txt
123445614COW.txt
123456789ASK.txt
232436787CAT.txt
and I want to check if the file has COW inside the name.
Every solution I have found so far has assumed I know the contents already, but in my case that may not always be true and I need to check.

In AppleScript, how do I copy a directory's contents to another directory without deleting the destination directory's existing files?

I'm trying to copy files and directories from one directory called "Motion Templates" to another directory called "Motion Templates".
tell application "Finder"
set srcPath to ((parent of (path to me) as text) & "Motion Templates")
set dstPath to (((path to movies folder) as text) & "Motion Templates")
set srcFolder to folder srcPath
set dstFolder to folder dstPath
duplicate entire contents of srcFolder to dstFolder with replacing
end tell
The source directory (Motion Templates) contains a subdirectory (Generators) which successfully copies over to the destination "Motion Templates" in terms of matching file paths (from a source "Motion Templates/Generators" to a destination "Motion Templates/Generators"). However, this script also deletes all of the existing subdirectories that existed in "Motion Templates/Generators". How do I go about copying/overwriting files without deleting the other existing files in the tree?
This is far to confusing to explain when you are using the same names. It's like trying to understand Who's on first for the first time. Try using different folder names until you can get it working then worry about what things are called.
To try and help the only thing I can say is if the files have the same exact names and you use the "with replacing" it will overwrite what ever is in the destination folder. If you are saying the source folder is being deleted then you are having an issue where the files are being moved and not duplicated.

How do I copy existing files and create a duplicate files using xcopy?

I can't seem to find a way to copy an existing file but I do not want to let the previous file with the same name get overwritten. Let say I want to copy data.txt from various pc's by using batch file but I do not want "data.txt" gets overwritten, instead is there a way for the command to generate automated filename to avoid it from overwritten?
You can use the "/-y" switch to confirm before copying a duplicate file.
/-y : Prompts to confirm that you want to overwrite an existing
destination file.
The entire list of switches can be found here

Batch File Copying

I am trying to copy a file from the C:\ drive to the steam directory using this
copy "C:\CSS.zip" "C:\%ProgramFiles86%\Steam\CSS.zip"
but it always makes a new folder and places the file in a new folder called %ProgramFiles86% but i want it to go in the actual Program Files (x86)
Thanks for the help
You aren't using the program files path correctly. Your code should be this:
copy C:\CSS.zip "%programfiles(x86)%\CSS.zip"

Navigating a Zipped Filesystem

I have found that, with some file zippers like 7-Zip, it is possible to use files inside the created archives. For example, if I create a file my-zip-file.7z, containing folder my-folder, with files this-file.docx and that-file.html I can use 7zip to go into my-zip-file.7z and open the 2 files, and see or change the contents, even if the original my-folder is deleted! How is this possible?
If you look at the file path for whatever you're editing you'll see that the document is saved to a temporary folder. When you save (or possibly close) 7-Zip then updates the zip file with the saved content.

Resources