Internet Marketing Coding

Coding Techniques for Internet Marketing

How To Copy A Locked File On Windows 7

Published: Fri 7th Oct 2011

When you watch an online video, the FLV file is temporarily stored on your computer and then deleted when the video gets to the end. During the playback, the video file is locked so you can't pause the video, locate the temporary file and copy it to a permanent location as you would do with non-temporary files.

Although I did manage to do this for some videos playing in the chrome browser, but a large file >100MB was stored in a diffrerent location and locked.

To be able to see temporary files you need to go to Control Panel > Appearance and Personalization > Folder Options and select "Show hidden files and folders". To get there quickly, search on "hidden" in the start menu search box.

Now you can browse your user data folders to find the hidden files. Here is where I found the temporary video file for Chrome: C:\Users\MyName\AppData\Local\Temp Sorting by "Name" or "Date Modified" helps you to find the file which will have a weird name. Another place to look may be: "C:\Users\YourName\AppData\Local\Google\Chrome\User Data\Temp". This may have been the folder where the temporary files were not locked.

With the video having fully downloaded (progress bar completed) and paused before it finishes playing, you can try to copy the temporary file, but you are likely to receive a warning that it can't be done since it is still in use.

Before Windows 7 I could use a simple unlocker utility that was added to windows explorer, where you right-click on a file and use the unlocker to copy it. But this didn't seem to work in Windows 7.

What did work is a free program called ShadowCopy.exe. This makes use of the Windows Volume Snapshot Service which needs to be available on your system. I found this running as a service in the Windows task manager (press CTRL+ALT+DEL to access the task manager) listed as VSS.

With ShadowCopy.exe installed, you should now be able to copy locked files on Windows 7. Initially ran it as a batch file with a command like:
"C:\Program Files (x86)\Runtime Software\ShadowCopy\shadowcopy.exe" C:\Users\MyName\AppData\Local\Temp\fla98xyz.tmp C:\Users\MyName\Desktop

i.e. the line above was saved to copy.bat and this was run from a command window (enter cmd into the start menu search box, and open a command window as an administrator {right click}).

Then I discovered that it works equally well when you open the application up from Windows as an administrator. Then you have to fill in the form fields for the source and destination paths, along with the file name.

Note that the time taken to process the file copy is 10s of seconds long, check the progress via the messages displayed at the bottom of the application's window.

If you don't run this as an administrator, you will get a permission denied error. Once the file is copied (to the Desktop in my case), rename it to something.flv and it should play in kmplayer or vlc media player.

If you have any questions or tips about how to copy a locked Windows 7 file please post a comment to stimulate discussion on the topic.

User Icon
User Avatar
Vallerie . {{getAge(1320107818)}}
This is a great advice since I am using windows 7 starter. Thanks for sharing. I will might use this for future references.
User Avatar
Maverick . {{getAge(1320258797)}}
I am lucky I had this chance to read your post. I have been searching advises on how can I copy the locked files from windows. Thank you for sharing this. Please keep it up!
User Avatar
Klara . {{getAge(1318655741)}}
very useful advices, i wondered since i use the Vista how could i manage this problem. my hubby has a mac, do you maybe know, how could he manage the same thing (deleting the temporary downloaded/saved flash movie files) under OSX? thanks
User Avatar
Andrew ⇒ Klara . {{getAge(1318669982)}}
For Vista, I think that shadow copy can be used (when you are in admin mode). For the Mac, temporary internet files may be buried deep inside subdirectories under: ~/Librar/Caches/Safari/ but I don't use a Mac so not sure. You probably need specialist software to easily grab the files. Hope this helps.
User Avatar
Yumigee . {{getAge(1321020676)}}
Thanks for sharing this ! I have the same problem and now i solved it thanks to you .. some i can hide some of my files too ! ^_^
User Avatar
Andrew ⇒ Yumigee . {{getAge(1321057590)}}
Hi Yumigee, it's great that you got your problem solved :)
User Avatar
gracia19 . {{getAge(1320428125)}}
Thank you for sharing this post! Thank you for putting it in a simple instructions on hot to. I will download the software you mentioned and see if I'll be able to install it! I'm not that techie!
User Avatar
Andrew . {{getAge(1345133125)}}
I have an update to the method in my post. When I paused a video and closed the page with the video search results, the cached video file was moved. This was with Google Chrome. The new location of the .tmp file was in: C:\Users\UserName\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\ And, the file was not locked, so could be copied to the desktop with Ctrl+mouse and renamed to .flv To find the hidden file you can search on .tmp using the "Everything" search utility. Then sort by date to see which temporary file was created around the time you played the video.