Jump to content











Photo
- - - - -

driver setting in registry vs command line switch


  • Please log in to reply
12 replies to this topic

#1 bilou_gateux

bilou_gateux

    Frequent Member

  • Expert
  • 230 posts
  •  
    France

Posted 29 September 2007 - 05:22 PM

All driver settings are in a very "techincal" format in the registry, basically based on the data structure the user mode applications send to the driver when a new virtual disk is created. You can create a registry key HKLM\SYSTEM\CurrentControlSet\Services\ImDisk\Parameters.

I'm a little lost on this one, can someone help me out.

Basically, i want to automount at boot an image containing Lotus Notes 7.0.2 - NOMAD.

The command line used in batch script:
:Mount

if not exist "%ProgramFiles%\Lotus" md "%ProgramFiles%\Lotus"

  imdisk -a -t vm -f %~dp0Nomad.img -m "%ProgramFiles%\Lotus"

:AutoStart

::# "%ProgramFiles%\Lotus\notes\notes.exe" "=%ProgramFiles%\Lotus\notes\notes.ini"

ImDisk is already installed.
Should i set /v "Start" /t REG_DWORD /d "0" for both ImDisk and ImDskSvc? Current data value is "3"
What are the correct registry settings?

#2 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

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

Posted 30 September 2007 - 09:43 AM

Basically, i want to automount at boot an image containing Lotus Notes 7.0.2 - NOMAD.

First, the registry settings equivalent to you command line, in the form of a .reg file:
Windows Registry Editor Version 5.00



[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ImDisk\Parameters]

"Flags0"=dword:00000200

"FileName0"="\\??\\C:\\Directory\\Images\\Nomad.img"

"LoadDevices"=dword:00000001
Change the FileName0 setting to the correct path to the image file.

Then, set the imdisk driver to autostart. That can be done with the reg command but I prefer the sc command for changing service control settings for drivers and services. In this case:
sc config imdisk start= auto
This will give you a RAM-disk automatically when Windows starts, with the image file loaded to it. Then you will need to fix the junction point so that the directory "%ProgramFiles%\Lotus" actually redirects to the ImDisk drive. You can use my junc.exe tool for that and this command line syntax:
junc "%ProgramFiles%\Lotus" \Device\ImDisk0\

This should make it.

#3 was_jaclaz

was_jaclaz

    Finder

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

Posted 30 September 2007 - 10:12 AM

If I may:

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\ImDisk\Parameters]

is not always the "right" ControlSet.

One should either use "CurrentControlSet" or inspect via the batch the
HKEY_LOCAL_MACHINE\SYSTEM\Select
key and act accordingly.
As an example the 2K machine I am writing from has this contents:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\Select]
"Current"=dword:00000002
"Default"=dword:00000002
"Failed"=dword:00000001
"LastKnownGood"=dword:00000003


(due to a corrupted controlset)

jaclaz

#4 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

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

Posted 30 September 2007 - 10:15 AM

If I may:

is not always the "right" ControlSet.

One should either use "CurrentControlSet" or inspect via the batch the
HKEY_LOCAL_MACHINE\SYSTEM\Select
key and act accordingly.

Absolutely. I just did a copy-and-paste and did not really check that part. I have corrected my post to "CurrentControlSet" now.

#5 bilou_gateux

bilou_gateux

    Frequent Member

  • Expert
  • 230 posts
  •  
    France

Posted 30 September 2007 - 03:23 PM

If I may:

is not always the "right" ControlSet.

One should either use "CurrentControlSet" or inspect via the batch the
HKEY_LOCAL_MACHINE\SYSTEM\Select
key and act accordingly.
As an example the 2K machine I am writing from has this contents:
(due to a corrupted controlset)

jaclaz

Offline registry editing here, that's why i have selected ControlSet001 which is Default in my case.

@Olof,
I agree with you. Change status of a service with the right tool is even better.

#6 ktp

ktp

    Silver Member

  • Advanced user
  • 758 posts

Posted 05 October 2007 - 09:30 AM

I always found adding reg/inf to BartPE/UBCD4Win a little "technical". For ImDisk I believe a plugin
(inf/xml) was posted by someone. But I found it is easier (at least for me) to just after BartPE boot,
to click on ImDiskinst.exe, then in the Control Panel I find the usual umbrella applet :-).
Of course it is not permanent, but sufficient for me. ImDisk looks like then as portable application for me,
which I like a lot. A vast majority of portable applications run under BartPE, so it is really nice
(no install, no explicit registry tweaking).

For adding portable applications, I do not create a plugin for each of them, just use Total Commander to the
right application directory and start them. For a little housekeeping, you can also use pstart which is much
user-friendly than nu2menu, with dynamic menu creation, very useful for USB key (writable).

#7 bilou_gateux

bilou_gateux

    Frequent Member

  • Expert
  • 230 posts
  •  
    France

Posted 15 October 2007 - 10:18 AM

When the command used to mount the image is:
imdisk -a -f %~dp0P_Notes.img -m  "%ProgramFiles%\Lotus"

what's the command to unmount it:
i can check the mounted images with

imdisk -l
\Device\ImDisk0
\Device\ImDisk1


but my mounted image has no drive letter assigned and i can't use the command imdisk -d -m <drive_letter>

I hope i haven't already ask this question in an another thread but can't find an answer.

#8 was_jaclaz

was_jaclaz

    Finder

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

Posted 15 October 2007 - 11:50 AM

I am not sure this is the "correct" answer, but what I normally do is:
imdisk -l
and I have, say, the same output you got:

\Device\ImDisk0
\Device\ImDisk1

then I issue:

imdisk -l -u 0


and

imdisk -l -u 1



from the output I get which device number is assigned to the image, (0 in my case), then I issue:

imdisk -d -u 0


The above can easily be made into a few lines of batch. :cheers:

jaclaz

#9 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

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

Posted 15 October 2007 - 01:15 PM

When the command used to mount the image is:

imdisk -a -f %~dp0P_Notes.img -m  &#34;%ProgramFiles%\Lotus&#34;

what's the command to unmount it:

imdisk -d -m &#34;%ProgramFiles%\Lotus&#34;


#10 blobbo

blobbo
  • Members
  • 1 posts
  •  
    United Kingdom

Posted 02 November 2007 - 06:34 PM

Please could you give an extra explanation, Olof.

Using the example you gave at the beginning of this thread, to autostart imdisk using registry settings


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ImDisk\Parameters]
"Flags0"=dword:00000200
"FileName0"="\\??\\C:\\Directory\\Images\\Nomad.img"
"LoadDevices"=dword:00000001


I tried this to replace the following command line start

imdisk.exe -a -t vm -f c:\ramdisk.img -m R:

and created the following registry keys after reading through the source of imdisk, but not fully understanding what it does.

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ImDisk\Parameters]
"Flags0"=dword:00000200
"FileName0"="\\??\\C:\\ramdisk.img"
"DriveLetter0"="R:"
"LoadDevices"=dword:00000001

I have also set the imdisk service to autostart using the sc command as described in your earlier post.

I have varied the FileName0 string and th DriveLetter0 string (maybe it should be a Dword?), but I cannot get the drive image to load at start up.
if I enter the same commandline as before, it works fine.

Please can you advise on what should be in the registry.

Thanks in advance.

#11 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

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

Posted 02 November 2007 - 07:57 PM

I have no idea, everything looks ok to me. Can you check if the drive gets loaded but just missing the drive letter? You would see it in the Control Panel applet listed as a drive without a driveletter in that case.

#12 bilou_gateux

bilou_gateux

    Frequent Member

  • Expert
  • 230 posts
  •  
    France

Posted 03 November 2007 - 01:15 PM

Please could you give an extra explanation, Olof.

Using the example you gave at the beginning of this thread, to autostart imdisk using registry settings


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ImDisk\Parameters]
"Flags0"=dword:00000200
"FileName0"="\\??\\C:\\Directory\\Images\\Nomad.img"
"LoadDevices"=dword:00000001


I tried this to replace the following command line start

imdisk.exe -a -t vm -f c:\ramdisk.img -m R:

and created the following registry keys after reading through the source of imdisk, but not fully understanding what it does.

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ImDisk\Parameters]
"Flags0"=dword:00000200
"FileName0"="\\??\\C:\\ramdisk.img"
"DriveLetter0"="R:"
"LoadDevices"=dword:00000001

I have also set the imdisk service to autostart using the sc command as described in your earlier post.

I have varied the FileName0 string and th DriveLetter0 string (maybe it should be a Dword?), but I cannot get the drive image to load at start up.
if I enter the same commandline as before, it works fine.

Please can you advise on what should be in the registry.

Thanks in advance.

@blobbo

I have the same issue: no drive letter assigned to the mounted image.
I finally gave up on this one and currently trying another free RamDisk for the purpose of mounting a ramdisk at boot and set %temp% and IECache data to it.

I need to use a fully operational solution at boot for a shared computer (Internet kiosk public access PC) with all temporary data stored on RamDisk not kept at shutdown.
For my own usage, i will continue to use ImDisk as it has a lot of nice other features.
Hope Olof may find why it don't works with our Windows boxes.

#13 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

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

Posted 03 November 2007 - 03:31 PM

@blobbo

I have the same issue: no drive letter assigned to the mounted image.
I finally gave up on this one and currently trying another free RamDisk for the purpose of mounting a ramdisk at boot and set %temp% and IECache data to it.

Just a couple of ideas while waiting for a better solution...

For this case, do you really need a drive letter? You could try to mount it under a subdirectory if you like (discussed earlier in this thread).

You could also try to assign the drive letter via Session Manager registry settings. Add a string value under HKLM\SYSTEM\CurrentControlSet\Session Manager\DOS Devices, set the name of the string value to the drive letter followed by a colon and the value data to \Device\ImDisk0. When you reboot, the drive letter will be pointing to the first ImDisk device. The drawback is that the ImDisk driver does not "know" about this drive letter so that it can't show it for example in the Control Panel applet.

Hope Olof may find why it don't works with our Windows boxes.

As it looks right now the chances are not very big that I will find out what is wrong, because I cannot reproduce the problem on any of my test machines. So, I have no idea where to start looking for anything... :cheers: :cheers:

If anyone get any kind of clues about when this problem happens, please post as many details as possible here.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users