Installing imdisk.sys manually using sc.exe
#1
Posted 07 December 2011 - 07:47 AM
I want to install the driver itself (imdisk.sys) to be manually installed and run using sc.exe. I do not want to use the installer provided.
The reason is to simply check and compare my driver which basically creates virtual drives and imdisk. I can use "sc create myDriver type= filesys binpath= C:\myDriver.sys", and then use "sc start myDriver" successfully.
However when I copy just the Imdisk.sys from another clean machine (with no previous imdisk installation), and use the commands "sc create Imdisk type= filesys binpath= C:\Imdisk.sys" or "sc create Imdisktype= kernel binpath= C:\Imdisk.sys" it installs fine, but when I run "sc start Imdisk" it fails with the error 193. The event viewer error showed that this is not a valid win32 application.
I am new to this, but then how can I am able to create and start my driver, but not Imdisk, considering the fact that both are file system drivers (.sys files) ?
I am stuck here and I would really appreciate if there is a way to do manual installation of the Imdisk driver using sc.exe and point out what am I missing ot doing wrong here?
Regards.
#2
Posted 07 December 2011 - 09:32 AM
http://reboot.pro/5531/
Try using IMDISK.EXE to start the service.
Or try using net start imdisk.
Wonko
#3
Posted 07 December 2011 - 09:38 AM
Hi,
I want to install the driver itself (imdisk.sys) to be manually installed and run using sc.exe. I do not want to use the installer provided.
The reason is to simply check and compare my driver which basically creates virtual drives and imdisk. I can use "sc create myDriver type= filesys binpath= C:\myDriver.sys", and then use "sc start myDriver" successfully.
However when I copy just the Imdisk.sys from another clean machine (with no previous imdisk installation), and use the commands "sc create Imdisk type= filesys binpath= C:\Imdisk.sys" or "sc create Imdisktype= kernel binpath= C:\Imdisk.sys" it installs fine, but when I run "sc start Imdisk" it fails with the error 193. The event viewer error showed that this is not a valid win32 application.
First of all, for imdisk.sys, type of service should be "kernel", not "filesys". ImDisk is not in any way a filesystem driver. You could get all sorts of strange phenomenons if you use incorrect service type in this way.
Then, for kernel drivers and filesystem drivers you need to specify native path to sc, not Win32 path. This means that C:\imdisk.sys is an invalid path, it should be for example \??\C:\imdisk.sys or, if driver file is somewhere under Windows directory you can start from there with a relative path such as system32\drivers\imdisk.sys. Notice that driver files are normally installed in <windows>\system32\drivers directory.
I am new to this, but then how can I am able to create and start my driver, but not Imdisk, considering the fact that both are file system drivers (.sys files) ?
I am stuck here and I would really appreciate if there is a way to do manual installation of the Imdisk driver using sc.exe and point out what am I missing ot doing wrong here?
Just copy imdisk.sys to your <windows>\system32\drivers directory. Then type for example:
sc create imdisk type= kernel start= auto error= ignore binPath= system32\drivers\imdisk.sys
#4
Posted 08 December 2011 - 06:27 AM
Thanks for your reply. I copied Imdisk.sys in the "System32drivers" directory, then executed "sc create imdisk type= kernel start=auto error= ignore binpath= system32driversimdisk.sys" which executed successfully as usual. However when I tried to start the service using "sc start Imdisk" or with "net start Imdisk" it failed with error 193 as I had encountered initially. What is wrong here, what am I missing? Can you please help?
FYI, I am testing it on Windows 7 x86 virtual machine on VMware player.
Regards,
#5
Posted 08 December 2011 - 12:09 PM
#6
Posted 05 February 2012 - 05:22 AM
Let me ask you a question in case I want to install imdisk.sys manually.
How do I do digital signature for imdisk.sys driver? In imdiskinst.exe , it seems there's some information about digital signature?
Thank you in advance.
M.Truong.
#7
Posted 05 February 2012 - 08:15 AM
#8
Posted 05 February 2012 - 10:58 AM
Thank you for your answer. I just don't want these thing when users install imdisk driver with my program.
1. This message: Because I want to inform user installation succeeds at the end, not when imdisk driver is successfully installed.
2. Right click menu: Because I don't want users accidentally unmount imdisk disk. I want users to unmount disk via my program.
I might annoy you, but could you please tell me how to config these things or could you please package for me?
Thank you in advance.
#9
Posted 05 February 2012 - 11:20 AM
You could just install imdisk.sys manually. Either using sc.exe command line tool or through SCM API. Or as an alternative, you could use imdisk.inf but just comment out the things that install Explorer context menu items. Should be pretty ovious which lines it is if you open imdisk.inf in notepad.
#10
Posted 05 February 2012 - 01:55 PM
I did change imdisk.inf file, use 7-zip to create installer... but I failed.
Because I did not uninstall correctly so I could not intall correctly.
Before uninstall, we must stop service...but I did not (stupid mistake )
Now, I could create new custom installer.
Thank you very much for your smart way (digital sign only .sys files)
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users