Jump to content











Photo
- - - - -

The easy way to auto-create an ImDisk RAMdisk with a TEMP folder on startup


  • Please log in to reply
16 replies to this topic

#1 Bad_Machine

Bad_Machine

    Newbie

  • Members
  • 13 posts
  •  
    United Kingdom

Posted 19 July 2012 - 12:10 PM

Hi guys

A few months ago I created a small ImDisk guide at the SSD review forums, expaining how to configure a startup task, which will automatically create a RAMdisk of the size and file system of your choice on every Windows startup. In the guide I create a 25000MB RAMdisk with the exFAT file system, (exFAT in my benchmarks has produced the fastest results), labeled it as RAMDISK and auto-created a TEMP folder in it. You can change the file system to NTFS if you want to and pick any size and label you like, for as long as you have enough RAM left for the system.

Regarding the TEMP folder creation I probably could have used a batch file that uses a VBScript file, but I wanted to keep it as straight-forward and as simple as possible - and it works this way anyway. Hope this helps novice users who may want to use this excellent software. The guide is here:

http://thessdreview....ftware/1834.htm

Edited by Bad_Machine, 19 July 2012 - 12:20 PM.

  • TheHive and FloJo like this

#2 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2,813 posts
  •  
    United States

Posted 19 July 2012 - 01:30 PM

Welcome Bad_Machine :)

That's a nice guide and a nice forum -- Thanks!

:cheers:

#3 Bad_Machine

Bad_Machine

    Newbie

  • Members
  • 13 posts
  •  
    United Kingdom

Posted 19 July 2012 - 01:35 PM

You're welcome amalux! :beer:

#4 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1,008 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 19 July 2012 - 08:20 PM

Hi guys

A few months ago I created a small ImDisk guide at the SSD review forums, expaining how to configure a startup task, which will automatically create a RAMdisk of the size and file system of your choice on every Windows startup. In the guide I create a 25000MB RAMdisk with the exFAT file system, (exFAT in my benchmarks has produced the fastest results), labeled it as RAMDISK and auto-created a TEMP folder in it. You can change the file system to NTFS if you want to and pick any size and label you like, for as long as you have enough RAM left for the system.

Regarding the TEMP folder creation I probably could have used a batch file that uses a VBScript file, but I wanted to keep it as straight-forward and as simple as possible - and it works this way anyway. Hope this helps novice users who may want to use this excellent software. The guide is here:

http://thessdreview....ftware/1834.htm


Thanks a lot for putting together your guide! ImDisk really needs guides and how-to's, so this is really appreciated!

Is it okay if I add a link to it from ImDisk website and in the FAQ in this forum?

:cheers:

#5 Bad_Machine

Bad_Machine

    Newbie

  • Members
  • 13 posts
  •  
    United Kingdom

Posted 19 July 2012 - 09:58 PM

Thank you for your kind words Olof, and also for writing this great software in the first place. You can link my guide anywhere you want, the more people that can use it the better!

#6 FloJo

FloJo
  • Members
  • 2 posts
  •  
    United States

Posted 19 July 2012 - 11:53 PM

WOW I literally just made an account to ask there were a simple guide for this since I've never found one until yours :) I now have an SSD and 32GB of RAM in my laptop and plan to use a 24GB disk for scratch space, temp, and page files. I failed miserably in programming class in college, so I was considering spending $20 to just get a commercial RAMDisk that wouldn't waste hours of my time trying to figure out automatic page creation etc...


Thank you!!!

Edited by FloJo, 19 July 2012 - 11:59 PM.


#7 Bad_Machine

Bad_Machine

    Newbie

  • Members
  • 13 posts
  •  
    United Kingdom

Posted 20 July 2012 - 01:53 AM

Thank you all for your great comments.

Apart from the usual benefits of keeping the TEMP and Temp Internet folders on RAMdisk, a large RAMdisk is great for many other things too. To me it is essential for video and audio file remuxing/transcoding. Conversions fly when the source and the destination are both in RAM, especially on a powerful computer.

I also use Sandboxie and have assigned its container folder to reside on the RAMdisk. Every program I run into the sandbox now runs straight from RAM, saving SSDs from a lot of unnecessary hits. It also saves HDDs from a lot of future fragmentation.

If you create an NTFS RAMdisk you can also use NTFS junctions to force certain programs to use the RAMdisk for their temporary folders. There are a few posts here that can help:

http://answers.micro...0b-57b3a8b8ff44

You can do it from an elevated command prompt as described on the link above, or you can use the excellent Junction Link Magic (it's freeware):

http://www.rekenwond.../linkmagic.htm/

For me the best thing about a large RAMdisk is gaming through it. I always install games on a 2TB USB 3.0 HDD, and when I want to play I just copy the whole game folder to the RAMdisk and run the game executable from there. Level loading is ultra-fast this way. I have also moved My Documents and Saved Games folders (which hold most game saves by default) along with all my other user folders to a secondary HDD, so I don't need to start copying saves over after playing. Nowadays only a few games keep their saves in their installation folder; for those I just copy the saves back to the original game folder on the HDD, then I delete the game folder from the RAMdisk after playing.

Even if I restore my C: partition to an earlier snapshot that was taken before a game was installed (I use Rollback RX for this), most games will still load as standalones from any folder. For as long as the location of My Documents and Saved Games folders has been changed to a secondary disk/partition, then most game saves will keep being updated regardless of the location of the game folder itself. Of course this is not 100% foolproof, some games actually land necessary files on C, this can happen even when you choose to install them on a secondary disk. Restoring an older snapshot will cause such games to need to be installed again, since the files they put on C: will be gone. In such cases I still install the game to my usual gaming HDD and just take a new snapshot of C:. When I want to play I load the snapshot, then copy the folder to the RAMdisk and enjoy fast loading times. The snapshot size will be very small since the game was installed on my USB 3.0 disk - so only a few game files will have actually landed on C:

I hope it all makes sense, if you start using this methodology you'll know what I mean.

#8 FloJo

FloJo
  • Members
  • 2 posts
  •  
    United States

Posted 20 July 2012 - 04:06 AM

Yes I've thought about loading games up into images as well... my main priority is first getting the system properly allocated so photoshop and web browsers use the ramdisk, and later Ill probably get some game images made :)

#9 TheHive

TheHive

    Platinum Member

  • .script developer
  • 3,804 posts

Posted 20 July 2012 - 07:50 AM

Very Usefull.

#10 Bad_Machine

Bad_Machine

    Newbie

  • Members
  • 13 posts
  •  
    United Kingdom

Posted 23 July 2012 - 10:53 AM

A user can also create simple batch files to automate the creation of specific folders on the RAMdisk, and also the copying of files or folders to the RAMdisk on every startup. The syntax is very simple. In this example assuming that the RAMdisk has been assigned the letter R: I just create a copy of my SkyRim game folder from drive D: to the RAMdisk:

@ECHO OFF
TIMEOUT 30
MD "R:The Elder Scrolls V - Skyrim"
xCOPY "D:##The Elder Scrolls V - Skyrim" "R:The Elder Scrolls V - Skyrim" /K /E /H /O /F


I have set this batch file to delay execution of its commands for 30 seconds after it is ran using the TIMEOUT command. The reason for this is that we don't want this batch file to run before the Scheduled Task that creates the RAMdisk itself. I left 30 seconds to elapse which is sufficient for my system, change it to what is best for your own system. You can interrupt the timer and execute the commands immediately by pressing a key. Or you could create a new Scheduled Task for this batch file and set the new task to run with a delay.

Use the MD command and supply the paths for the folders you want to create, then use xCOPY to copy your files/folders over. Save it as a batch file and make a shortcut for it at C:ProgramDataMicrosoftWindowsStart MenuProgramsStartup in order for it to auto-execute with every reboot.

Edited by Bad_Machine, 23 July 2012 - 11:51 AM.


#11 besez

besez
  • Members
  • 4 posts
  •  
    Sweden

Posted 12 September 2012 - 06:12 PM

Hi one and all!

When using the method linked here:

Hi guys

A few months ago I created a small ImDisk guide at the SSD review forums, expaining how to configure a startup task, which will automatically create a RAMdisk of the size and file system of your choice on every Windows startup. In the guide I create a 25000MB RAMdisk with the exFAT file system, (exFAT in my benchmarks has produced the fastest results), labeled it as RAMDISK and auto-created a TEMP folder in it. You can change the file system to NTFS if you want to and pick any size and label you like, for as long as you have enough RAM left for the system.

Regarding the TEMP folder creation I probably could have used a batch file that uses a VBScript file, but I wanted to keep it as straight-forward and as simple as possible - and it works this way anyway. Hope this helps novice users who may want to use this excellent software. The guide is here:

http://thessdreview....ftware/1834.htm


I got the following problem:
* No RAMDisk was created at reboot
* When checking in Task Scheduler, my ImDisk task reports some error code e.g. Last Run Result = 0x8007051F


So I found another method while googling for help
* Start gpedit.msc
* Edit the windows startup script to call a .bat with imdisk & TEMP directory creation.

Now, I just have one problem:

Dropbox needs to access the windows TEMP dir quite early (I put it to the RAMDisk at K:TEMP) - but when it tries to access it at startup (autostart) it says that it's not available!

If I try to restart dropbox manually a few seconds later, it works!

How can I make ImDisk start as EARLY as possible to avoid failing early access to TEMP directory?

Thanks!

Edit: Created a separate thread for my question http://reboot.pro/17494/

Edited by besez, 12 September 2012 - 06:28 PM.


#12 v77

v77

    Frequent Member

  • Team Reboot
  • 214 posts
  •  
    France

Posted 20 September 2012 - 12:58 PM

@Bad_Machine :

Why use a bat file? For your first example, we get 2 commands :

imdisk -a -s 1000M -m R: -p "/fs:exFAT /v:RAMDisk /q /y"
cmd /c md R:Temp

It does exactly the same, and it is a lot more simple. No need for a bat file... And if you have other commands, you can simply add them to the task.


By the way, use the trigger "At startup" does not work for me : Windows (7 and 8) seems to randomly, and rarely, run this trigger, even with the "Run task as soon as possible after a scheduled start is missed" option checked, and even for native tasks of Windows. I have to use "At log on" to get it working properly. I investigate this strange issue.

Edited by v77, 20 September 2012 - 01:00 PM.


#13 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 10,843 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 20 September 2012 - 01:16 PM

By the way, use the trigger "At startup" does not work for me : Windows (7 and 8) seems to randomly, and rarely, run this trigger, even with the "Run task as soon as possible after a scheduled start is missed" option checked, and even for native tasks of Windows. I have to use "At log on" to get it working properly. I investigate this strange issue.

Maybe these help :unsure::
http://www.sevenforu...ams-change.html
http://www.sevenforu...tartup-log.html

:cheers:
Wonko

#14 v77

v77

    Frequent Member

  • Team Reboot
  • 214 posts
  •  
    France

Posted 20 September 2012 - 02:21 PM

Maybe these help :unsure::
http://www.sevenforu...ams-change.html
http://www.sevenforu...tartup-log.html

:cheers:
Wonko

Thanks for the clue. I have found something in the TaskScheduler/Operational event log. To run imdisk as soon as possible, I have checked the "Run whether user is logged on or not" option, but to do this, we have also to change the user account, because he is not yet logged on. I changed this to "System" account, and now it works perfectly. :)

#15 Bad_Machine

Bad_Machine

    Newbie

  • Members
  • 13 posts
  •  
    United Kingdom

Posted 20 September 2012 - 02:49 PM

Hi guys, sorry for not logging in earlier but I was on holiday, and as soon as I came back work beckoned with a vengeance... :smiling9:

Thank you for your input V77! I just like batch files, old habits die hard I suppose... Regarding the startup trigger not working for you, I can't really say why this is happeneing. It works just fine on my three Win7 Ultimate x64 systems, and also on my wife's system (which is also Win7 Ultimate x64). The only thing I can think of ATM off the top of my head is this: Have you tried to run the task with highest privileges? Tick that box and see if it solves it for you.

@besez Again this is an issue I was unable to recreate on any of my systems. You can however slow down the loading priority of DropBox using Start-Q, this should give you enough time for the RAMdisk and the TEMP folder to be created, before DropBox tries to acces it. Get it here:

http://www.duriosoft...ts/start-q.html

Edited by Bad_Machine, 20 September 2012 - 02:56 PM.


#16 howardb21

howardb21
  • Members
  • 2 posts
  •  
    United States

Posted 23 February 2013 - 10:56 PM

Hi guys

A few months ago I created a small ImDisk guide at the SSD review forums, expaining how to configure a startup task, which will automatically create a RAMdisk of the size and file system of your choice on every Windows startup. In the guide I create a 25000MB RAMdisk with the exFAT file system, (exFAT in my benchmarks has produced the fastest results), labeled it as RAMDISK and auto-created a TEMP folder in it. You can change the file system to NTFS if you want to and pick any size and label you like, for as long as you have enough RAM left for the system.

Regarding the TEMP folder creation I probably could have used a batch file that uses a VBScript file, but I wanted to keep it as straight-forward and as simple as possible - and it works this way anyway. Hope this helps novice users who may want to use this excellent software. The guide is here:
http://thessdreview....ftware/1834.htm
I never understood the necessity of using the task scheduler to load imdisk as a ramdisk whenever windows starts. I just created a batch file to do it, and put it in the startup folder, like any other starup item (or inserted in in one of the registry's `run' places). Seemed to work just fine. A conflict with another app or two, which I fixed by adjusting the app and/or starting the app itself in the same batch file. Why use the task scheduler, when the startup folder and/or registry startup commands are designed just for that? Only thougt  I had was that when you start something with the scheduler ``when the computer starts'' - perhaps it loads before most other things, with the low level drivers, etc. ??

Edited by howardb21, 23 February 2013 - 11:00 PM.


#17 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1,008 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 23 February 2013 - 11:48 PM

I never understood the necessity of using the task scheduler to load imdisk as a ramdisk whenever windows starts. I just created a batch file to do it, and put it in the startup folder, like any other starup item (or inserted in in one of the registry's `run' places). Seemed to work just fine. A conflict with another app or two, which I fixed by adjusting the app and/or starting the app itself in the same batch file. Why use the task scheduler, when the startup folder and/or registry startup commands are designed just for that? Only thougt  I had was that when you start something with the scheduler ``when the computer starts'' - perhaps it loads before most other things, with the low level drivers, etc. ??

 

I could see a couple of reasons. First of all, if you schedule a task to run at system startup you can be sure that it is run only once and only during system startup. The task also always run will full, elevated privileges and drive letters and similar created by tasks there will be visible in all logon sessions. If you use some background services and want them to use your memory disk before you log on, you would also practically need some way to auto-run this task before you logon.

 

Also, if you put an ImDisk virtual disk creation task in your startup folder, you need to notice that this task will run once again if you log off and on again. If you have a pre-defined drive letter on the imdisk command line, such as -m R: or something like that, it will create a new memory disk with drive letter R: and hide the existing one. This means that the already existing drive will still be in memory with all files and directories on it, but not accessible through the drive letter. You could check this with the imdisk -l command line, or in Control Panel applet. "Lost devices" like this could be removed with imdisk -d -u command line or by selecting and removing one of the drives in Control Panel applet. To avoid this problem, you could add a check at the beginning of the ImDisk command line, such as if not exist R: to make sure that the command does not run if the drive already exists. Or add a dismount -d command before the add new -a command. Yet another alternative would be to add a fixed device number to the add new command line, such as imdisk -a -s 300M -p "/fs:exfat /q /y" -u 0 -m R:. This way, it will always attempt to use device number 0, which will fail the entire command if that device number is already allocated to an existing virtual disk.