What is wrong with my junction.exe command? - windows

I am trying to create a junction point on windows 8 so that files will be written on my HDD (D:) instead of my SSD (C:).
A few of the commands I've tried
D:\Downloads\Junction\junction.exe D:\Temp\Glasswire\service C:\ProgramData\GlassWire\service
D:\Downloads\Junction\junction.exe D:\Temp\Chrome\LocalStorage "C:\Users\Garvin\AppData\Local\Google\Chrome\User Data\Default\Local Storage"
The end result is that files are written to both the junction point directory and the destination directory. My understanding of junction points was that new files would only be written to the junction point directory, but are junction points actually just backup directories or am I doing something wrong here?
(Also I am using Windows 8)
EDIT: From what I see in task manager/Performance only my SSD shoots up in activity when dragging files to C:\Users\Garvin\AppData\Local\Google\Chrome\User Data\Default\Local Storage while the HDD stays at 0%. (I am dragging a 550mb video and 700mb exe from a USB)
I was attempting to reduce the number of writes the SSD performs to increase its lifespan but junction points do not seem to be the way to go, contrary to what is written here http://lifehacker.com/5802838/how-to-maximize-the-life-of-your-ssd

I've always used the built-in mklink /j command to create directory junctions in Windows. It seems to work fine -- just like a soft link in Linux.
Hese's some info from TechNet here: http://technet.microsoft.com/en-us/library/cc753194.aspx

Related

A "My Documents" for each game/program

So I have quite a few "Grab'n'Go" Windows games and programs that I've stuffed onto an external harddrive, and it is a little daunting to have all their saves end up on my C: drive. What I'm looking to do, and I hope this can be done on Windows XP at the least (if not 7 or 10), is to create a BAT file to trick each program to save their files somewhere else but C:\Documents\User\My Documents, and preferably a different folder for each program (Dungeon Siege to G:\DS_saves, RCT3 to H:\RCT3, etc).
Is such a thing possible? And is it a different command per Windows version?
You can't "trick" games while they're running, since you have no access to their code or the running threads.
However, you can accomplish what you're trying to do by simply right-clicking the Documents folder, go to Properties, then Location and change the target folder.
This will change the directory for Documents in your system, and your games/apps will use the new folder even if it's on a different drive.
This can be done for all system default directories, and it's very useful for SSD-based machines where space is essential.

How can i move files to a portable device using batch in windows7

I'm using Motorola MC67 (I'm not sure that matter, but it's a portable device) and i want to write a batch script to move files there. the problem is i can't call the device path because it's not mounted and i can't mount it. i couldn't find nothing on google about getting to the device not from the windows GUI. I read somewhere activeSync can sync from portable devices, but that's of no use to me.
anyway, i repeat, i need a way to move files from my computer to a portable device that isn't mounted. a way to mount the device will be good too, since i can then access it from batch file
First, you need to download Windows Mobile Developer Power Toys because it contains the cecopy utility, which this solution depends on.
Basically, all you need to do is:
cecopy file.exe dev:\file.exe
Here's the readme for cecopy.
INSTRUCTIONS:
Usage: CeCopy [options] <Source_FileSpec> <Destination>
Options:
/is Copy file even if identical.
/s Include subdirectories, hierarchy reproduced on device.
Arguments:
Source_FileSpec File specification denoting the source of the copy.
Destination Where files should be copied to.
For the source, wild cards or directory names may be specified, as may be single files. The destination can be either a directory or a file name, depending on the type of source specified.
By default, an argument is assumed to live on a local file system. To indicate that either argument denotes a location on a device connected via ActiveSync, prepend 'dev:' to that argument. To articulate that a local file system is referenced, prepend 'desk:' to the argument.
Examples:
"cecopy readme.txt dev:\readme.txt" copies this readme to the device's root.
"cecopy /s *.* dev:\" copies all files and subfolders of current directory to device's root. Generates new folders on device as needed.
"cecopy /s *.dll dev:\windows" copies all dlls and dlls in subfolders of current directory to the device's root. Generates new folders on device as needed.
Well, you can't mount the device per se, but you can access it via the Windows Portable Devices api. There are some application samples here, but they're in C++. There's a scripting interface, but that seems to be limited to the device stage experience, and doesn't really seem to be available from, say, Powershell.
the total commander recognize the device and can be used to transfer files through it, and be used progrematicly

Windows Batch Filesystem Backup

Update:
Ehh -- Even though this question isn't "answered", I've just emptied my pockets and purchased an SSD. My ramdisk software was going to cost just about as much anyway. I'm not particularly interested in an answer here anymore, so I'll just mark this as "answered" and go on with my life.
Thanks for the help.
I've got a program which is writing files to a ramdisk (in Windows XP) and I need to copy its data from the ramdisk to a directory on my harddrive once it has finished execution. Obviously in a ramdisk the space is limited and I need to free up as much space on the ramdisk as I can between runs. The simple solution is to copy the data folder that my program generates on the ramdisk to a location on the harddisk and recursively delete the "data" folder from the ramdisk.
There is a problem with that solution however; my program looks at the filesystem and filenames to ensure that it doesn't overwrite files (The most recent data file in the directory is 006.dat, so it will write 007.dat instead of overwriting anything). I can't just delete the files once I'm done writing data because it needs that filesystem intact to record data without over-writing the old files when I copy the data back to my hard-drive
I'd like a simple little windows batch script which I can execute after my program has finished writing data files to the ramdisk. This batch script should copy the ramdisk "data" folder to my harddisk and delete all the files from the ramdisk, then it should re-create the filesystem as it was but with all zero-byte files.
How would I go about this?
Could you simply have it delete all files EXCEPT the most recent, then you would still have 006 and your logger would generate 007?
That seems safer than creating a zero length file because you would have to make sure it wasn't copied over the real 006 on the backup.
edit: Sorry can't help with how to do this solely in batch, but there are a bunch of unix utils, specifically find and touch that are perfect for this. There are numerous windows ports of these - search on SO for options.
Robocopy.exe (free download in the windows server resource kit) can do copy from one dir to another AND has the option to watch a dir for new files and copy them when they are closed or changed

Linking files or folders to another drive

I would like to be able to map (or link) one logical folder or file to another on a different harddrive.
I have Virtual Ram HDD and I want to link game files from HDD to RAM ones.
I remember finding a program a couple years back that would trick the system into thinking one folder was really another, but I can't find it. I think it was JumpLink or something.
Anyway, I want to be able to do this:
When the system wants to access 'C:\Game\' it will really access 'X:\Game\' but still think it's on the former drive.
I am not looking to use 'subst' either. I just want to map that folder or and files to the other.
Sounds like you're talking about mounting a file system to a directory on a drive. A quick google search led me to this Server Fault Question: https://serverfault.com/questions/11350/is-it-possible-to-mount-unmount-a-physical-hard-drive-in-windows-xp
To quote Ramon,
Try mountvol [drive:]path /d. For, info type mountvol /? (just mountvol) in cmd.exe.
See that question for complete details and caveats.
This is what I was thinking about:
http://en.wikipedia.org/wiki/Symbolic_link

Is creating hardlinks from linux on a ntfs partition viable?

I have found a program that can make you save space by hardlinking files that are actually the same, thus leaving only one copy of the file on the file system with more than one hardlink pointing to it. The program is called hardlink.
This is very nice as I have at last found a way to save space on my backup disk for old backups I have made before I knew about rsync and incremental backups.
After such a lengthy introduction, any reader would expect a question, so here it is:
Would it be safe to use hardlinks to save space on a ntfs partition? The hardlinks would of course be created from Linux, using the hardlink program mentioned above. More precisely, will Windows (any version) be able to then use the files that would have been replaced by hardlinks?
Many thanks
There are hardlinks on Windows. They are created by the CreateHardLink system call in kernel32.dll. As to whether your hardlink program would work over remote shares, I wouldn't know, but a native one or one from cygwin would.
Now the real question is whether or not Windows programs handle them. Even Windows Explorer fails to calculate disk space used for hardlinks correctly.
I did a small test. Creating a hardlink (using 'ln TargetName LinkName') yields the same file at creation time, but after that the file and the hardlink content change independently. I would therefore discourage any use of unix based hard links on an NTFS partition. Use either an Ext4 partition (linux only) or software adapted for windows-like links on NTFS partitioning (windows software or perhaps some linux software if explicitly mentioned).
I guess that the program hardlink will either fail because hard links doesn’t exists on Windows or create Windows shortcuts.

Resources