Jump to content











Photo
- - - - -

How to auto-mount images (no gui shown)


  • Please log in to reply
8 replies to this topic

#1 zilexa

zilexa
  • Members
  • 6 posts
  •  
    Netherlands

Posted 17 December 2008 - 12:19 AM

Is it possible to change the behaviour of the command that is launched when I right-click a common image file like .ISO, choose "Mount as Imgdisk Virtual disk".

The action that should follow: the image will automatically be mounted in a virtual CD/DVD drive, without showing the ImgDisk GUI.

Is this possible?

Also, I do not understand 2 options in the GUI wen I mount an ISO CD or DVD image: "Removable media" and "read-only media". When I mount an ISO image to CD/DVD-ROM, these options should always be checked (at least by default) and read-only so you cannot uncheck it, right?

#2 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1358 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 17 December 2008 - 07:48 AM

Is it possible to change the behaviour of the command that is launched when I right-click a common image file like .ISO, choose "Mount as Imgdisk Virtual disk".

The action that should follow: the image will automatically be mounted in a virtual CD/DVD drive, without showing the ImgDisk GUI.

Is this possible?


You can create a new menu item for this if you like.

Under HKCR\*\shell create a new subkey and name it for example ImDiskAutoMount. Create a subkey under that key and name it command. Edit the default value for that key and type imdisk -a -f "%L" -m #:

Something like that should work.

Also, I do not understand 2 options in the GUI wen I mount an ISO CD or DVD image: "Removable media" and "read-only media". When I mount an ISO image to CD/DVD-ROM, these options should always be checked (at least by default) and read-only so you cannot uncheck it, right?


The checkboxes you are mentioning have no effect for CD/DVD images. But it is still useful to show the GUI so that drive letter and other settings can be changed before mounting the image.

#3 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 17 December 2008 - 09:30 AM

Just in case, these may prove to be useful (right click or context menu related thingies):
http://www.xs4all.nl...dios/Associate/
http://students.kenn...hext_index.html
:)

jaclaz

#4 zilexa

zilexa
  • Members
  • 6 posts
  •  
    Netherlands

Posted 17 December 2008 - 10:57 AM

Olof Lagerkvist thanks for that! I am going to try it.
And jaclaz thanks! But I prefer changing it directly in the registry :)

I have another question that's not related to my previous questions but it might not be worth creating a new topic: I would like to integrate this application in my unattended windows cd, I have add applications to this cd so that if I need a fresh windows install, all my favourite applications are automatically installed.
But I couldn't find a silent switch for imgdisk? If there really isn't one, I am going to create an AutoIt script wich will automatically press OK during imgdisk install.

#5 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1358 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 17 December 2008 - 12:15 PM

But I couldn't find a silent switch for imgdisk? If there really isn't one, I am going to create an AutoIt script wich will automatically press OK during imgdisk install.

The install package uses 7-zip sfx module which takes a -y switch for silent start. This means:
imdiskinst.exe -y
...should install everything automatically. :)

There are also different ways to use scripts to copy necessary files to right places and create the services. The imdisk.inf file in the install package will tell you pretty much what is needed, but essentially something like this:

copy %source%\imdisk.exe %SystemRoot%\system32\

copy %source%\imdsksvc.exe %SystemRoot%\system32\

copy %source%\imdisk.cpl %SystemRoot%\system32\

copy %source%\imdisk.sys %SystemRoot%\system32\drivers\

sc create imdisk type= kernel start= demand error= ignore binPath= system32\drivers\imdisk.sys DisplayName= "ImDisk Virtual Disk Driver"

sc create imdsksvc type= own start= demand error= ignore binPath= imdsksvc.exe DisplayName= "ImDisk Virtual Disk Driver Helper"

:(

#6 zilexa

zilexa
  • Members
  • 6 posts
  •  
    Netherlands

Posted 17 December 2008 - 05:52 PM

Thanks for the switch, I've created a lot of 7z SFX's with Oleg's modified SFX module so I recognize the -y :) I should have tried that myself before asking!

I played with the registry for a while because the "%L" part wasn't working, don't know why, but now it does work. I've created a .reg file that will remove the "mount with Imdisk" option since it is shown for all file types, even non-image files. And it will create a command for image files to mount directly to a virtual drive :(

The upload function gives me an error so I uploaded the .reg file here:
http://ifile.it/j31z...mountoption.reg

#7 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1358 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 17 December 2008 - 07:32 PM

Thanks for the switch, I've created a lot of 7z SFX's with Oleg's modified SFX module so I recognize the -y :) I should have tried that myself before asking!

No problem!

I played with the registry for a while because the "%L" part wasn't working, don't know why, but now it does work. I've created a .reg file that will remove the "mount with Imdisk" option since it is shown for all file types, even non-image files. And it will create a command for image files to mount directly to a virtual drive :(

Your .reg file removes the mount menu item even for many image file types, for example .vfd, .vhd, .img, .sdi and a few others. This could still be useful if you never mount such image files or if you only mount them from command line or Control Panel. Also, the .reg file breaks other associations of for example .iso files, so if you have a menu option for burning an .iso to a CD it will be removed by this .reg file... :(

Otherwise it is of course a good idea! :)

#8 zilexa

zilexa
  • Members
  • 6 posts
  •  
    Netherlands

Posted 17 December 2008 - 07:55 PM

Whoops you are right.. I don't have such an option so I didn't realize it.

Actually it was an existing reg file I used in combination with Daemontools and Daemonscript. I modified it to work with ImDisk.

I've spend enough time on it for today, might post a better regfile later.

#9 amalux

amalux

    Platinum Member

  • Tutorial Writer
  • 2813 posts
  •  
    United States

Posted 21 December 2008 - 11:29 PM

You can create a new menu item for this if you like.

Under HKCR\*\shell create a new subkey and name it for example ImDiskAutoMount. Create a subkey under that key and name it command. Edit the default value for that key and type imdisk -a -f "%L" -m #:

This works very well in my XP (HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\--) and is just what I was looking for :cheers: - Thank you!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users