I have a custom script I use for backing up my hard drive to a temporary external drive. It's a simply a number of robocopy lines (without /PURGE). I've having trouble with the windows documents folder. If I have a command: "robocopy C:\users\me\documents D:\backups\somerandomdirectoryname ..", every time it's done, Windows thinks that directory is a Documents directory and even renames "somerandomdirectoryname" to "Documents". It changes the icon, and then I can not actually eject the USB drive because Windows will not let it go. What is causing Windows to do this to me? Is there something I have to exclude to make it "just a normal directory" on my external device?
Found a cure to this, use the option:
/XA:SH
which stops copying system and hidden files - which are how the special attributes of the Document directory appear to be copied. Worked for me, I only wanted the data files.
Related
How do you make a PC unzip a downloaded file with one click in Chrome? Macs do this, why not PCs?
On my Mac, when I download a .zip file, it shows in the bottom bar of Chrome. If I click once on that download in the Chrome bottom bar, it unzips the archive into the same directory ("Downloads") without any further interaction from me.
How can a PC user get a file to unzip with that same convenience? Everything I've tried requires you to go to make two or three steps.
Here's how to do it. It is not nearly as seamless and quick as on a Mac, but it works without any user interaction by monitoring your download folder for archives. When one shows up in the folder, it automatically unzips the archive and can optionally delete the .zip, or run a command line, or what-have-you. On a slow PC I tested it on, it took about 40 seconds to recognize there was a new archive and to process it. Hopefully that's faster on faster PCs.
Here are the basics:
download ExtractNow onto PC from http://www.extractnow.com
in the Settings tabs, under Monitor, select the path to the folder want to monitor and check the "Automatically extract" checkbox.
That's basically it.
Additionally you can run a command. I needed to do something a little unusual - open an .html file from the just-expanded archive using Microsoft Word - and I was able to get it to do that automatically. Here's what I entered in the Process tab under the "Archive operation complete" section:
check the "Run a program" checkbox
in the Command: box, enter this:
winword {ArchiveFolder}"{ArchiveName}.html"
You can tweak that for your circumstances. The point is that ExtractNow can pass info about the archive (the name, the path, etc.) in bracketed, named variables so that you can use them to invoke other commands or processing.
I don't love the time lag, but it completely does what I wanted and more. Cheers!
The Problem is an excel file on a network drive which is to be opened from a .cmd file in the same folder. As I'd rather not tamper with the registry on a machine at work, I used the pushd command to switch to the directory and open the file. Unfortunately pushd maps the path to a temporary drive letter which usually does not exist anymore when I save the excel file. Of course I could just use save-as and select the network path, yet it is rather tedious doing this on a daily basis.
Question(s):
Is there a way to circumvent the drive letter mapping and open the excel file from cmd on the network path without touching the registry?
Or, which seems more probable, is there a way to change the saving path of the excel file automatically to the required network path? I assume you could change some variable onWorkbookOpen, yet I don't know which...
Just in case, here's the batch code...
pushd \\%~P0
START excel.xlsm
I just restarted my laptop today because it was saying there was problem with one of the disks and it needed to restart to fix it, so I restarted it. But when it was booting it came across to a problem and was not able to boot and showed me some options. So under "refresh" it was saying it won't delete any files but it may delete apps, which was fine for me so I chose this and waited about 15-20mins to do the job.
Once it was done windows started normally and I got my old desktop with old names of my files. Everything was fine except I was not able to find the folder I have been working on for the last two months (which I did not backup stupidly, though I intended a few times but was lazy and I had no worry about losing the data). The folder was just at the middle of my desktop with the name "equation derivation". I can not freaking find it. All of my other folders are here but not THE ONE that is supposed to be. I am just freaking out here.... I had many matlab codes and PDF files inside this folder.
I tried to restore but there is no restore point because of freaking "refresh".
I tried to use a recovery program to show me some files, but it found almost nothing.
There is a "windows.old" file which has user accounts but in that one there are fiveusers: Administrator, guest, ibaha_000, Public, UpdatusUser. Last three folder's creation date is today and first two folders creation date is when I bought the laptop (2014-HP-Envy) . When I go inside ibaha_000 folder (or any others) there are some folders inside it and I try to go inside "Desktop" because the folder I am trying to find was on desktop, but there is nothing there at all. So "windows.old" did not restore any of my files....
When I search for any of the matlab file names or folder names or PDF file names on the search of PC, I get no result.
Please someone help me with this I really need someone's help to recover my files that I spent two months... (And I know I should have backed it up but there was no sign of anything like this I would have, stupid me...)
Thank you very much!
I was able to recover my files from the hard-disk with professional "active at" recovery program that ran about 8 hours to pull out data.
Refresh might delete your files because it might recognize some of your programs or text files as windows program files, as it happened in my case. It didn't delete all of my matlab files, it deleted the folder I have lots of .m files.
So before refreshing windows, BACKUP your data, that's the solution.
I am trying to edit the corflags file so that I can run 32bit applications on a 64 bit pc but everytime I try to edit the file using something like corflags.exe assembly /32bit+ it comes up with the error message cf001 could not open file for writing.
Now I have tried a lot of different options such as:
Running in administrator mode;
Finding the file using a search and checking read only is not ticked
Checking that user full control is ticked
Tried to set the whole folder to non read only
When trying the whole folder, it goes through looking like it has set read-only, but then I click OK and re-right click on the whole folder, the box is filled in (not ticked) does this mean that part of the folder is read only and why does it reset to read only?
I just faced the same problem and have tried the same things.
Run cornflags from an elevated ("Run as administrator") Visual Studio Command Prompt. I did the same for a copy of the original .exe just to make sure no other process was using the program.
Create a copy of the file you intend to target with CorFlags.
(e.g. "WcfServiceHost.exe" --creates--> "WcfServiceHost - Copy.exe")
Rename the original file to something else:
(e.g. "WcfServiceHost.exe" --> "WcfServiceHose_Original.exe")
Rename to copy to the original file name
(e.g. "WcfServiceHose - Copy.exe" --> "WcfServiceHost.exe"
For my purposes, I created copies and named them describing their configuration:
Example:
WCFServiceHost_With32BitOn.exe
WCFServiceHost_With32BitOff.exe
Now I can destroy the WCFServiceHost.exe files and create them from these pre-modified copies. No more CorFlags operations necessary.
Note: this is basically a more verbose version of #RMalke answer and that answer should be marked as the answer.
I realise this is years later, but for anyone else looking, I found that the quickest way was to copy cmd and corflags.exe into the same folder as the one you want to edit. Then run cmd as admin from there.
I'm having trouble using macros in my .inf file that I'm using to create my cab, specifically when setting the InstallDir string. If I do something like this:
InstallDir=\<PathToProgramFiles>\MyAppName
then everything works fine. However, if I do this:
InstallDir=%CE1%\MyAppName
then I get the following error when trying to install the cab (double tapping it on my device): "MyAppName was not installed successfully. Please run Setup again."
This only seems to apply to the built-in macro strings. I can use %AppName% without any problems. Maybe there is some registry setting that isn't properly set that would normally resolve the %CE1% macro?
Any ideas about what is going on?
Edit: My device doesn't have a \Program Files directory. It seems the %CE1% macro always resolves to that path and if the InstallDir specified in the inf file doesn't exist (with the exception of the last directory portion then the install fails. Manually creating \Program Files fixed the issue. Since a lot of the devices I'm working with have different paths for their Program Files directory, is there a generic way to get the installer to default to the actual Program Files dir? I guess my only other option is to not specify a path and force the user to choose one?
First, in this link you can find the shortcuts and their meaning (the %C..%), goto appendix B. The Windows CE5 MSDN link.
You can add a Setup Dll to your CAB installaer that will check the directory structure and will create a folder in case it does not exist. You may find this SO question useful.
A warning: If you are targeting regular Windows CE devices, beware where you place the files as it can be to a RAM based file system and then the files will disappear after reboot.