MSFN Forum: searching for CDROM - MSFN Forum

Jump to content



Unattended CD/DVD Guide Homepage · MSFN Forum Rules

Welcome to the Applications Installs forum. Make sure you read the forum rules before you start posting.

Links/Requests to warez and/or any illegal material (porn, cracks, serials, etc..) will not be tolerated. Discussion of circumventing WGA/activation/timebombs/keygens or any other illegal activity will also not be tolerated.

We try our best to keep this forum clean of illegal content. If you see any illegal activity use the "report" button you find in every post to report the specific post to the moderators. If you ignore any of the rules you will be banned without notice.

Read Forum Rules
  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

searching for CDROM removable drives present Rate Topic: -----

#1 User is offline   WotC 

  • Member
  • PipPip
  • Group: Members
  • Posts: 127
  • Joined: 29-January 05

Posted 05 April 2006 - 12:05 PM

Hi!

Sorry if this was covered already, but the search didn't work for me. Here's my problem: i'm searching for cdrom drives using the common:

for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\whatever.ico set cdrom=%%i:\


This worked pretty fine - till i got a card reader. Now i get an error box all the time windows searches for the cdrom drive :-(. is there any known method to circumvent this annoying popup?

Error-Message-Title: Windows - No Disk
Message-Text: There is no disk in the drive. Please insert a disk into drive.

Cancel / Try again / Continue

Any hints are welcome...


#2 User is offline   gunsmokingman 

  • MSFN Addict
  • Group: Super Moderator
  • Posts: 1,991
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 05 April 2006 - 05:40 PM

Try a VBS script
This script will check for all CD or DVD drives if there a disk in the drive then it produce a message box to confirm a disk in the drive. If there is no disk in the drive another message box is produced that say the drive is empty.

Quote

Dim Drv, Fso, StrDrv
  Set Fso = CreateObject("Scripting.FileSystemObject")
  Set Drv = Fso.Drives 
   
   For Each StrDrv In Drv
	If StrDrv.DriveType = 4 Then 
	 If StrDrv.IsReady = True  Then 
	  MsgBox "This CD or DVD drive has a disk in it : " & StrDrv.DriveLetter, 0 + 32,"Disk In Drive"
	 Else 
	  MsgBox "This CD or DVD drive has no disk in it : " & StrDrv.DriveLetter, 0 + 32,"Empty Drive"
	 End If 
	End If 
   Next


This one will check for a specific file on any CD or DVD drive, when the check file is found it will produce a message box that say This is a XP CD then it will quit the script.
Change this color in the script to suit your needs.
If Fso.FileExists(StrDrv.DriveLetter & ":\win51ip.SP2") Then

Quote

Dim Drv, Fso, StrDrv
  Set Fso = CreateObject("Scripting.FileSystemObject")
  Set Drv = Fso.Drives 
   
   For Each StrDrv In Drv
	If StrDrv.DriveType = 4 Then 
	 If StrDrv.IsReady = True  Then 
	  If Fso.FileExists(StrDrv.DriveLetter & ":\win51ip.SP2") Then 
		MsgBox "This is a XP CD : " & StrDrv.DriveLetter, 0 + 32,"Confirm XP CD"
		Exit For 
	  Else 
	   MsgBox "This is not a XP CD : " & StrDrv.DriveLetter, 0 + 32,"Missing XP CD"
	  End If
	 End If 
	End If 
   Next


#3 User is offline   MHz 

  • SendToA3X v1.7
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,634
  • Joined: 02-August 04

Posted 05 April 2006 - 08:17 PM

View PostWotC, on Apr 6 2006, 04:05 AM, said:

This worked pretty fine - till i got a card reader. Now i get an error box all the time windows searches for the cdrom drive :-(. is there any known method to circumvent this annoying popup?

Error-Message-Title: Windows - No Disk
Message-Text: There is no disk in the drive. Please insert a disk into drive.

Cancel / Try again / Continue

Any hints are welcome...

With the little info given, here is my assumption...
Seems like Windows Setup is possibly recognizing you Card Reader as a CDRom, which steals the letter used by the Windows Setup CD. Or it is disrupting the drivers of the CDRom which in effect leaves Windows Setup lost as the CD is not seen anymore. Adding the drivers for your Card Reader during textmode setup through the use of $OEM$ method may help, else perhaps you may need to leave the Card Reader disconnected during Windows Setup.

#4 User is offline   muiz 

  • SPECIAL
  • PipPipPipPipPipPip
  • Group: Banned
  • Posts: 1,055
  • Joined: 03-August 03
  • OS:none specified
  • Country: Country Flag

Posted 05 April 2006 - 08:18 PM

@gunsmokingman

Quote

it produce a message box to confirm a disk in the drive
But i dont want to click butons during setup , is there no other way?


@MHz

Quote

perhaps you may need to leave the Card Reader disconnected during Windows Setup.


This is what im doing , and thats the best solution till now.

This post has been edited by muiz: 05 April 2006 - 08:22 PM


#5 User is offline   MHz 

  • SendToA3X v1.7
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,634
  • Joined: 02-August 04

Posted 05 April 2006 - 08:20 PM

View Postmuiz, on Apr 6 2006, 12:18 PM, said:

Quote

it produce a message box to confirm a disk in the drive

But i dont want to click butons during setup , is there no other way?

What do you refering to, muiz ?

#6 User is offline   muiz 

  • SPECIAL
  • PipPipPipPipPipPip
  • Group: Banned
  • Posts: 1,055
  • Joined: 03-August 03
  • OS:none specified
  • Country: Country Flag

Posted 05 April 2006 - 08:21 PM

read all the posts , you will see ;)

#7 User is offline   MHz 

  • SendToA3X v1.7
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,634
  • Joined: 02-August 04

Posted 05 April 2006 - 08:28 PM

View Postmuiz, on Apr 6 2006, 12:21 PM, said:

read all the posts , you will see ;)

OK, you experience exactly the same issue.
Thanks for alerting me.

#8 User is offline   gunsmokingman 

  • MSFN Addict
  • Group: Super Moderator
  • Posts: 1,991
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 05 April 2006 - 09:05 PM

Here the same script with out the message boxes, you will have to edit the file it checks for to suit your needs.

Quote

Dim Drv, Fso, StrDrv
  Set Fso = CreateObject("Scripting.FileSystemObject")
  Set Drv = Fso.Drives 
   
   For Each StrDrv In Drv
	If StrDrv.DriveType = 4 Then 
	 If StrDrv.IsReady = True  Then 
	  If Fso.FileExists(StrDrv.DriveLetter & ":\win51ip.SP2") Then 
		'''' PLACE_SCRIPT_HERE_THAT_YOU_NEED_BELOW_HERE
   
		Exit For 
	  End If
	 End If 
	End If 
   Next

This was a template nothing more but then I assume most people would know that.

Quote

muiz Posted Today, 03:18 AM
@gunsmokingman

QUOTE
it produce a message box to confirm a disk in the drive

But i dont want to click butons during setup , is there no other way?


@MHz

QUOTE
perhaps you may need to leave the Card Reader disconnected during Windows Setup.


This is what im doing , and thats the best solution till now.


#9 User is offline   nateklomp 

  • MS Junkie since DOS2.1
  • PipPip
  • Group: Members
  • Posts: 122
  • Joined: 12-May 04

Posted 06 April 2006 - 02:07 AM

I've had the same problem with Zip100 Drives, I'll try your script out.

Thanks!

#10 User is offline   muiz 

  • SPECIAL
  • PipPipPipPipPipPip
  • Group: Banned
  • Posts: 1,055
  • Joined: 03-August 03
  • OS:none specified
  • Country: Country Flag

Posted 06 April 2006 - 03:27 AM

@MHz
No problem ;)


@gunsmokingman

THX for your reply

But how and at wich point do i use your script?

#11 User is offline   gunsmokingman 

  • MSFN Addict
  • Group: Super Moderator
  • Posts: 1,991
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 06 April 2006 - 04:20 AM

The script will detect only CD or DVD drives I was only giving a alternative to this
for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\whatever.ico set cdrom=%%i:\

Since the vbs script will only detect CD or DVD drives it should avoid the push button problem with the card reader, as to how he was using the above or when he was using it I do not know.

If you post what you have and are trying to do, I will try and help you fix the problem.

#12 User is offline   WotC 

  • Member
  • PipPip
  • Group: Members
  • Posts: 127
  • Joined: 29-January 05

Posted 06 April 2006 - 09:52 AM

@MHz: Sorry for the little info given. I was to busy. What i am doing is installing applications using WPI. whenever an application was installed i call a *.cmd file where start menu adjustments are made ar files like *.inis are copied to the %programfiles%\APP_whatever path. therefore i need to check where my install DVD is (e.g. which drive letter it has). i could do this just once at the beginning (did this originally) but then i though maybe i want to install additional programs later on, thats why i splitted my "one-file-cleanup" into several files.
The windows setup cd is NOT lost - just this annoying popups (yes, because windows is so stupid and thinks i got a new cdrom drive...). i think adding drivers is not of any help because windows recognizes it (USB device, if i put in a card i can access it immediately). so disconnecting the reader is the only way obviously (or go back to my "single-file-cleanup" - **** - i hate this :-(.
but thanks for your advice...

@gunsmokingman&muiz:
But i dont want to click buttons during setup , is there no other way? :D

@gunsmokingman: i'll check your script, thanks - just one question (if you are faster anserweing it than i am trying it :-)):
If Fso.FileExists(StrDrv.DriveLetter & ":\win51ip.SP2") Then
		'''' PLACE_SCRIPT_HERE_THAT_YOU_NEED_BELOW_HERE
		  Exit For


i can put my xcopy blablabla.... here? with or without cmd /c ?

THANKS

edit: hmm, using the script and adding a "whatever.cmd" to be called doesnt do anything at all?! what am i doing wrong?

This post has been edited by WotC: 06 April 2006 - 12:07 PM


#13 User is offline   gunsmokingman 

  • MSFN Addict
  • Group: Super Moderator
  • Posts: 1,991
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 06 April 2006 - 01:54 PM

View PostWotC, on Apr 6 2006, 04:52 PM, said:

@MHz: Sorry for the little info given. I was to busy. What i am doing is installing applications using WPI. whenever an application was installed i call a *.cmd file where start menu adjustments are made ar files like *.inis are copied to the %programfiles%\APP_whatever path. therefore i need to check where my install DVD is (e.g. which drive letter it has). i could do this just once at the beginning (did this originally) but then i though maybe i want to install additional programs later on, thats why i splitted my "one-file-cleanup" into several files.
The windows setup cd is NOT lost - just this annoying popups (yes, because windows is so stupid and thinks i got a new cdrom drive...). i think adding drivers is not of any help because windows recognizes it (USB device, if i put in a card i can access it immediately). so disconnecting the reader is the only way obviously (or go back to my "single-file-cleanup" - **** - i hate this :-(.
but thanks for your advice...

@gunsmokingman&muiz:
But i dont want to click buttons during setup , is there no other way? :D

@gunsmokingman: i'll check your script, thanks - just one question (if you are faster anserweing it than i am trying it :-)):
If Fso.FileExists(StrDrv.DriveLetter & ":\win51ip.SP2") Then
		'''' PLACE_SCRIPT_HERE_THAT_YOU_NEED_BELOW_HERE
		  Exit For


i can put my xcopy blablabla.... here? with or without cmd /c ?

THANKS

edit: hmm, using the script and adding a "whatever.cmd" to be called doesnt do anything at all?! what am i doing wrong?

You would need to make a new Object
Here a re-edit script for you, this script will run only if a XP CD in the drive is XP SP2
Saves this as THE_NAME_YOU_WANT.vbs

Quote

I have added a new object to this it called Act, this script assumes the batch file is in the same location as the vbs script. If you have a full path to the Batch it will still work EG : H:\Folder\YOUR_CMD_FILE_NAME.cmd would work where PLACE_CMD_NAME_HERE
Dim Act, Drv, Fso, StrDrv
  Set Act = CreateObject("Wscript.Shell")
  Set Fso = CreateObject("Scripting.FileSystemObject")
  Set Drv = Fso.Drives 
   
   For Each StrDrv In Drv
	If StrDrv.DriveType = 4 Then 
	 If StrDrv.IsReady = True  Then 
	  If Fso.FileExists(StrDrv.DriveLetter & ":\win51ip.SP2") Then 
		'''' PLACE_SCRIPT_HERE_THAT_YOU_NEED_BELOW_HERE
		 Act.Run("PLACE_CMD_NAME_HERE"),1,True
		Exit For 
	  End If
	 End If 
	End If 
   Next


This is a demo VBS using %Comspec% and doing a action, this will only run if a XP CD is in the drive and must be SP2.
Save As THE_NAME_YOU_WANT.vbs

Quote

Dim Act, Drv, Fso, StrDrv
  Set Act = CreateObject("Wscript.Shell")
  Set Fso = CreateObject("Scripting.FileSystemObject")
  Set Drv = Fso.Drives 
   
   For Each StrDrv In Drv
	If StrDrv.DriveType = 4 Then 
	 If StrDrv.IsReady = True  Then 
	  If Fso.FileExists(StrDrv.DriveLetter & ":\win51ip.SP2") Then 
		'''' PLACE_SCRIPT_HERE_THAT_YOU_NEED_BELOW_HERE
		 Act.Run("%Comspec% /C @Echo Off && CLS && Mode 55,5 " &_
		 "&& Color 3f && Echo. && Echo %ComputerName% && set /p = %UserName% Press Key To Close"),1,True
		Exit For 
	  End If
	 End If 
	End If 
   Next


You can change the check file name if you like to suit your needs
Change this color text to suit your needs,
this is the files it checks for on a CD or DVD drive.
If Fso.FileExists(StrDrv.DriveLetter & ":\win51ip.SP2") Then

#14 User is offline   WotC 

  • Member
  • PipPip
  • Group: Members
  • Posts: 127
  • Joined: 29-January 05

Posted 07 April 2006 - 12:06 PM

hey hey hey... getting closer - thanks. one more question:

If StrDrv.DriveType = 4 Then


this checks only "real" cdrom drives, doesn't it? how can i change that to include fixed drives, too? i want to "override" the cdrom path with a harddrive path whenever a certain file is present. using that "trick" i don't need to burn a dvd every time im installing my system and nevertheless have the latest software installed. i would do two subsequent for loops for that purpose (because on my install dvd the files im'm checking for are located within e.g. xxx\yyy and on a fixed drive the path would be \unattended\xxx\yyy). would that work?

#15 User is offline   gunsmokingman 

  • MSFN Addict
  • Group: Super Moderator
  • Posts: 1,991
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 07 April 2006 - 12:47 PM

I have added another loop for the harddrive, just fill in the path that you need.

Quote

Dim Act, Drv, Fso, StrDrv
  Set Act = CreateObject("Wscript.Shell")
  Set Fso = CreateObject("Scripting.FileSystemObject")
  Set Drv = Fso.Drives 
   
   For Each StrDrv In Drv
	If StrDrv.DriveType = 4 Then 
	 If StrDrv.IsReady = True  Then 
	  If Fso.FileExists(StrDrv.DriveLetter & ":\win51ip.SP2") Then 
		'''' PLACE_SCRIPT_HERE_THAT_YOU_NEED_BELOW_HERE
		 Act.Run("%Comspec% /C @Echo Off && CLS && Mode 55,5 " &_
		 "&& Color 3f && Echo. && Echo %ComputerName% && set /p = %UserName% Press Key To Close"),1,True
		Exit For 
	  End If
	 End If 
	End If 
   Next 
 '''' CHECK FOR HARDDRIVE BELOW HERE ADD CORRECT PATH FOR FILE EXISTS
   For Each StrDrv In Drv
	If StrDrv.DriveType = 2 Then 
	  If Fso.FileExists(StrDrv.DriveLetter & ":\win51ip.SP2") Then 
		'''' PLACE_SCRIPT_HERE_THAT_YOU_NEED_BELOW_HERE
		 Act.Run("%Comspec% /C @Echo Off && CLS && Mode 55,5 " &_
		 "&& Color 3f && Echo. && Echo %ComputerName% && set /p = %UserName% Press Key To Close"),1,True
		Exit For 
	 End If 
	End If 
   Next

In the above you could also check for a folder exists also
EG If Fso.FolderExists(StrDrv.DriveLetter & ":\FOLDER_NAME_HERE") Then

This post has been edited by gunsmokingman: 07 April 2006 - 12:50 PM


#16 User is offline   WotC 

  • Member
  • PipPip
  • Group: Members
  • Posts: 127
  • Joined: 29-January 05

Posted 10 April 2006 - 12:11 PM

thanks! works like a charm. although i have to re-write all of my cmds - and thats quite a lot because i've collected about 120 apps during the last few years... but nevertheless... THANKS

#17 User is offline   muiz 

  • SPECIAL
  • PipPipPipPipPipPip
  • Group: Banned
  • Posts: 1,055
  • Joined: 03-August 03
  • OS:none specified
  • Country: Country Flag

Posted 11 April 2006 - 01:08 AM

View Postgunsmokingman, on Apr 7 2006, 07:47 PM, said:

I have added another loop for the harddrive, just fill in the path that you need.

Quote

Dim Act, Drv, Fso, StrDrv
  Set Act = CreateObject("Wscript.Shell")
  Set Fso = CreateObject("Scripting.FileSystemObject")
  Set Drv = Fso.Drives 
   
   For Each StrDrv In Drv
	If StrDrv.DriveType = 4 Then 
	 If StrDrv.IsReady = True  Then 
	  If Fso.FileExists(StrDrv.DriveLetter & ":\win51ip.SP2") Then 
		'''' PLACE_SCRIPT_HERE_THAT_YOU_NEED_BELOW_HERE
		 Act.Run("%Comspec% /C @Echo Off && CLS && Mode 55,5 " &_
		 "&& Color 3f && Echo. && Echo %ComputerName% && set /p = %UserName% Press Key To Close"),1,True
		Exit For 
	  End If
	 End If 
	End If 
   Next 
 '''' CHECK FOR HARDDRIVE BELOW HERE ADD CORRECT PATH FOR FILE EXISTS
   For Each StrDrv In Drv
	If StrDrv.DriveType = 2 Then 
	  If Fso.FileExists(StrDrv.DriveLetter & ":\win51ip.SP2") Then 
		'''' PLACE_SCRIPT_HERE_THAT_YOU_NEED_BELOW_HERE
		 Act.Run("%Comspec% /C @Echo Off && CLS && Mode 55,5 " &_
		 "&& Color 3f && Echo. && Echo %ComputerName% && set /p = %UserName% Press Key To Close"),1,True
		Exit For 
	 End If 
	End If 
   Next

In the above you could also check for a folder exists also
EG If Fso.FolderExists(StrDrv.DriveLetter & ":\FOLDER_NAME_HERE") Then



Sorry but i am new into vbs :blushing:
But still dont know where to put all this.

#18 User is offline   WotC 

  • Member
  • PipPip
  • Group: Members
  • Posts: 127
  • Joined: 29-January 05

Posted 11 April 2006 - 02:04 AM

wherever you want! just call it on purpose using a simple cmd/bat...
but one more question: how do i exit this script? i want the script to close itself whenever it has executed the cmd. so i dont want to run it twice if i have a DVD in my drive AND the folder i'm looking for on my harddisk, too!

If Fso.FolderExists(StrDrv.DriveLetter & ":\Unattended") Then
' PLACE_SCRIPT_THAT_YOU_NEED_BELOW_HERE
Act.Run("Opera.cmd"),1,True
Exit For


I would need an exit from the script right after calling my *.cmd. is WScript.Quit enough?
And - i haven't tried it yet (at least i think so) - when i call the *.vbs and the *.cmd is in the same directory i don't need the full path to the *cmd, do i?

This post has been edited by WotC: 11 April 2006 - 02:07 AM


#19 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 8,792
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 11 April 2006 - 03:18 AM

Well, actually it can be done from batch too.
Two examples from Rob Van der Woude Scripting site:
For XP only (uses diskpart):
http://www.robvander...les/cdromxp.txt
More generic:
http://www.robvander...rom.html#CdRom2


jaclaz

#20 User is offline   gunsmokingman 

  • MSFN Addict
  • Group: Super Moderator
  • Posts: 1,991
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 11 April 2006 - 04:27 AM

View PostWotC, on Apr 11 2006, 09:04 AM, said:

wherever you want! just call it on purpose using a simple cmd/bat...
but one more question: how do i exit this script? i want the script to close itself whenever it has executed the cmd. so i dont want to run it twice if i have a DVD in my drive AND the folder i'm looking for on my harddisk, too!

If Fso.FolderExists(StrDrv.DriveLetter & ":\Unattended") Then
' PLACE_SCRIPT_THAT_YOU_NEED_BELOW_HERE
Act.Run("Opera.cmd"),1,True
Exit For


I would need an exit from the script right after calling my *.cmd. is WScript.Quit enough?
And - i haven't tried it yet (at least i think so) - when i call the *.vbs and the *.cmd is in the same directory i don't need the full path to the *cmd, do i?

1:\ The script exit itself after the cmd file runs Exit For this is the cmd that does it.
2:\ It is alway best to give a full path to the file that you want to run.
Example I ran this script from my desktop which is on D:\Documents and Settings\Gunsmokingman\Desktop
to start this file C:\Testme\TheTest.txt, this needed a full path to the text file for it to run.

Quote

Dim Act, Drv, Fso, StrDrv
  Set Act = CreateObject("Wscript.Shell")
  Set Fso = CreateObject("Scripting.FileSystemObject")
  Set Drv = Fso.Drives 
   For Each StrDrv In Drv
	If StrDrv.DriveType = 2 Then 
	  If Fso.FolderExists(StrDrv.DriveLetter & ":\Testme") Then 
		  Act.Run(StrDrv.DriveLetter & ":\Testme\TheTest.txt")
		Exit For 
	 End If 
	End If 
   Next

This post has been edited by gunsmokingman: 11 April 2006 - 04:35 AM


Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy