Jump to content

Find NVIDIA or ATI via batch file


Recommended Posts

This cmd file could be modified to perform driver installations depending on your hardware. I've only had a chance to test this on 2 different machines & it worked fine. Please test this on your systems & let me know what kind of results you get. Requires DEVCON.EXE in your path.

Obtain devcon.exe here:

http://support.microsoft.com/default.aspx?...b;EN-US;Q311272

atiornv.cmd

@echo off 

:detect_vid
devcon find * | find "ATI" >NUL
if not errorlevel 1 goto ati
devcon find * | find "NVIDIA" >NUL
if not errorlevel 1 goto nvidia
goto neither

:nvidia
echo nvidia
goto end

:ati
echo ati
goto end

:neither
echo neither
goto end
:end

Link to comment
Share on other sites


That's a way to do it. I've been thinking about such issues a lot lately (this specific one as well so you can have both drivers on your unattended setup disc and have it install the right one with no hassles). You could also (possibly)...

1) use WMI (Select * from Win32_DisplayConfiguration);

2) export part of the HKLM\System\CurrentControlSet and use find in that;

3) use debug:

debug biosdump.txt <commands.txt

commands.txt containing these 2 lines:

d c000:0000 1ff

q

then use find on biosdump.txt

That dumps the first 512 bytes of the video bios, which has always contained either ATI or NVIDIA on all cards I've tested so far as well. (I guess I can't hide being old school and have coded lots of dos asm anymore? :unsure: makes me feel old in a way). I could write a tiiiiiiiny checkvid.com app that would "repne scasb" the video bios like that for either strings, and return an errorlevel accordingly too... (yes, I *still* got TASM 5 kickin' around!) Neater than debug.com and 2 redirections... (I've been meaning to code that for about 2 months now... Even though it's a 10 min job hehe)

and i'm sure there are more ways to it as well. The only problem is, I'm not 100% sure which one is the more reliable option. Depending at which stage it's run, WMI might not be an option(?). Registry is not the best way either imho. DevCon wise... I don't know for sure how it works, what dependencies it has, nor how it gets it's information, so I can't quite tell how reliable it is...

I posted a similar thing (using the registry export & find way) for conditionnaly applying the F-Lock registry tweak, but nobody ever answered. :(

Link to comment
Share on other sites

huh???

if u put the drivers of your nvidia and ati in your drivers folder

and specify the location in winnt.sif

it automatically loads the correct driver. i hv been doing this for a long time

The reason I would like to do it this way, is to use it during my FTP install, see the links in my sig for more info. I don't want to have to re-burn my cd. So being able to determine post-install & then install from my ftp works great.

Link to comment
Share on other sites

Utility is online:

edit: dead link

I had to zip it... it's a whole 264 bytes (and most of it is text). I've quickly ran it on 3 computers and so far it's worked perfectly. Feel free to do whatever you want with it...

It returns:

Errorlevel 3 for ATI;

Errorlevel 2 for NVIVIA;

Errorlevel 1 for other

(if you get a different errorlevel... something weird happenned!)

I had missed good ol' TASM...

[edit] my "quality" free web host took it down - a big thanks to them. If anyone wants it, just send me a message with your email adress and i'll send it directly to you.

Link to comment
Share on other sites

Good to see... There actually are more ways to it, so we're up to 5 methods now :)

1) devcon.exe & find

2) WMI (Win32_DisplayConfiguration)

3) regedit /e & find

4) video bios substring scan

5) nv4_disp.dll/atiddc.dll file check

and I'm sure we could still come up with more!

As for method 5, I'm not sure at what stage you guys use it, but it has to have the drivers already installed obviously. Although I won't be surprised when someone says my bios substring scan doesn't work because "NVIDIA" is say, at the 513rd byte in the BIOS :lol:

I don't think there actually is a "perfect"/100% fail-proof method.

Link to comment
Share on other sites

Well, considering there is usually a default ATI driver loaded from the XP source, it should still work.....assuming you check for the file that is the right one.

But when newer cards come out then there might be problems if you don't use OEMPnPDriversPath to instlal the driver first.

Link to comment
Share on other sites

a little off topic but could one of these methods be used to determine a mainboard chipset and then install the necessary drivers ie distinguish between nforce2 or VIA chipsets for instance?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...