Jump to content

A New Cd-switching Utility


Recommended Posts

1) Try

cdswitch Disc_2 /g:Disc_1 /d /r:*DRIVE*\WPI\WPI.hta

2) CDswitch.cmd is interesting, but I don't really know what's causing it. I couldn't reproduce too. What exactly do you mean with "recursing like maniac". :)

Link to comment
Share on other sites


1) Shall give it ago! (didn't know you could do it already)

2) I couldn't figure out what was happening so a removed all other commands from the cmd except executing CDSwitch.

All I saw was something like this:

...
IF Exist Y:\CD.txt Set CDROM=Y:\
IF Exist Z:\CD.txt Set CDROM=Z:\
IF Exist D:\CD.txt Set CDROM=D:\
IF Exist E:\CD.txt Set CDROM=E:\
IF Exist F:\CD.txt Set CDROM=F:\
IF Exist G:\CD.txt Set CDROM=G:\
IF Exist H:\CD.txt Set CDROM=H:\
...

This isn't accurate but you get the picture!

I'm not sure if recurse is the correct wording for this but it's a continuous process that never exits i.e. it never finds the drive.

If I change the name of the .cmd or run the same command from run I get no problem, finds the drive instantly.

It's not really a problem though, just strange :unsure: .

Edited by kof94
Link to comment
Share on other sites

  • 2 months later...

suggestions:

hint. im working in cmd...

1. when cdswitch /v /c /f:<file> in cmd window (first time) there is no variable in, but when i reload cmd it shows

is it fixable?

2. when cdswitch /v /c /f:<file> second time and installation cd/dvd is in other drive, in cmd sill is old variable, must reload cmd

is it fixable?

3. when cdswitch /v /d in cmd variable still exist (even if i reload cmd)

is it fixable?

4. is there (or will be) option to check if variable exist and it differes from new one, in cdswitch, eg.

i've CDDRIVE=l: but i put cd/dvd disk to other drive and i want to be sure is CDDRIVE variable is correct, if not rewrite it or submit errorlevel

5. (question), there are errorlevels, but echo %errorlevel% in cmd is still 0 ;) is it fixable?

btw. sorry for my bad english...

Link to comment
Share on other sites

I do it with a single line of code

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:\win51ip.SP2 set CDROM=%%i

You can replace the file details to look for as per your requirements. Please note the missing ":" in the set command.

Reversing the order of the alphabets would be a better option since the cd drive letter usually takes on a character after all the volumes are mapped. In this case there would be no errors in the event of finding a similarly named file in the root of a local volume.

If you create your volumes after installing the OS it creates another problem, i.e. the volumes will be assigned letters following the cdrom which might turn out to be "d:". So what I usually do is assign the cdrom drive letter "W" from run_once file using diskpart. On a single cd drive systems this invariably is volume 0.

I use a utility called wineject which takes on simple switch. The code is ...

wineject -open w

sleep 10

wineject -close w

wineject & sleep.exe of course are external files & freeware.

Link to comment
Share on other sites

suggestions:

hint. im working in cmd...

1. when cdswitch /v /c /f:<file> in cmd window (first time) there is no variable in, but when i reload cmd it shows

is it fixable?

2. when cdswitch /v /c /f:<file> second time and installation cd/dvd is in other drive, in cmd sill is old variable, must reload cmd

is it fixable?

3. when cdswitch /v /d in cmd variable still exist (even if i reload cmd)

is it fixable?

4. is there (or will be) option to check if variable exist and it differes from new one, in cdswitch, eg.

i've CDDRIVE=l: but i put cd/dvd disk to other drive and i want to be sure is CDDRIVE variable is correct, if not rewrite it or submit errorlevel

5. (question), there are errorlevels, but echo %errorlevel% in cmd is still 0 ;) is it fixable?

btw. sorry for my bad english...

1, 2, 3. cmd loads the variables at the startup. When you "load" cmd, it "loads" the variables. Pretty much nothing I can do about it.

4. Nope, there isn't, sorry. :) Maybe later, or a separate app, heh. :P

5. God, I once implemented it, but I have no idea what the state is on that. I should check that. :P

I do it with a single line of code

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:\win51ip.SP2 set CDROM=%%i

You can replace the file details to look for as per your requirements. Please note the missing ":" in the set command.

Reversing the order of the alphabets would be a better option since the cd drive letter usually takes on a character after all the volumes are mapped. In this case there would be no errors in the event of finding a similarly named file in the root of a local volume.

If you create your volumes after installing the OS it creates another problem, i.e. the volumes will be assigned letters following the cdrom which might turn out to be "d:". So what I usually do is assign the cdrom drive letter "W" from run_once file using diskpart. On a single cd drive systems this invariably is volume 0.

I use a utility called wineject which takes on simple switch. The code is ...

wineject -open w

sleep 10

wineject -close w

wineject & sleep.exe of course are external files & freeware.

I do recommend thern to use the "for... blah blah" to detect the drive (although I think WPI has a separate method to detect the drives?) but I don't really see what you're doing afterwards. :D

Link to comment
Share on other sites

my wishes nanaki. glad to be in touch with u after long time. ur program works great all times but in WPI, if i use cdswitch.exe to check for cd which is already there in the drive, WPI gives me debug error and WPI gets hanged and i have to use ctrl+alt+del to kill it. Also the cdswitch.exe "request" screen itself is not showing. i wanted to know is there any way for cdswitch to simply exit and returns to WPI normally, if the required cd is already in the drive. i remember that when cdswitch is executed directly in my cmd files, it didnt give me problem like this, but im not sure.

Link to comment
Share on other sites

the one which came with WPI5.5. the problem comes when installing office2003, ie installing word, excel, pp,access individually from wpi. i mean by selecting each one from wpi and not just the whole office CD. so what it does is install word first and then checks for cd label and then installs excel etc. so before installing each component, it checks for cd label. since its the same office2003 cd from which selected compnents has to be installed, the installation must go on. but what happens is after installing word, wpi shows debug error. the next line to be executed is cdswitch, before installing the next selected office component(excel or access or pp). just now i tested with other apps in WPI by inserting cdswitch command in them. it works well. so i found out there is not prob with cdswitch. may be with installation of office files. sorry for the inconvinence. i posted that coz i was trying various ways for past one day, but was testing using office portion. thanks very much.

Just now i found that it was due to the fact that office cd was present instead of WPI cd. Everytime WPI finishes installating a software, it is looking for installer.hta in WPI cd. so i just used cdswitch.exe after each software installation if that software is present in other than WPI cd.

Edited by rajesh.kumar
Link to comment
Share on other sites

suggestions:

hint. im working in cmd...

1. when cdswitch /v /c /f:<file> in cmd window (first time) there is no variable in, but when i reload cmd it shows

is it fixable?

2. when cdswitch /v /c /f:<file> second time and installation cd/dvd is in other drive, in cmd sill is old variable, must reload cmd

is it fixable?

3. when cdswitch /v /d in cmd variable still exist (even if i reload cmd)

is it fixable?

4. is there (or will be) option to check if variable exist and it differes from new one, in cdswitch, eg.

i've CDDRIVE=l: but i put cd/dvd disk to other drive and i want to be sure is CDDRIVE variable is correct, if not rewrite it or submit errorlevel

5. (question), there are errorlevels, but echo %errorlevel% in cmd is still 0 ;) is it fixable?

btw. sorry for my bad english...

1, 2, 3. cmd loads the variables at the startup. When you "load" cmd, it "loads" the variables. Pretty much nothing I can do about it.

4. Nope, there isn't, sorry. :) Maybe later, or a separate app, heh. :P

5. God, I once implemented it, but I have no idea what the state is on that. I should check that. :P

I do it with a single line of code

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:\win51ip.SP2 set CDROM=%%i

You can replace the file details to look for as per your requirements. Please note the missing ":" in the set command.

Reversing the order of the alphabets would be a better option since the cd drive letter usually takes on a character after all the volumes are mapped. In this case there would be no errors in the event of finding a similarly named file in the root of a local volume.

If you create your volumes after installing the OS it creates another problem, i.e. the volumes will be assigned letters following the cdrom which might turn out to be "d:". So what I usually do is assign the cdrom drive letter "W" from run_once file using diskpart. On a single cd drive systems this invariably is volume 0.

I use a utility called wineject which takes on simple switch. The code is ...

wineject -open w

sleep 10

wineject -close w

wineject & sleep.exe of course are external files & freeware.

I do recommend thern to use the "for... blah blah" to detect the drive (although I think WPI has a separate method to detect the drives?) but I don't really see what you're doing afterwards. :D

I am a 200 mb CD freak. I have broken up my full fledged windows installation in 3 parts.

The 1st cd is a multiboot cd which includes boot options that permit partitioning, formatting & installation of th main OS. On the same cd I have a minibrowser which has references to the following 2 CDs. One containing Applications & the oither a good selection of utilities.

When the user clicks on his selection, the routine copies a number of cmd files & winejcet to the root of %systemdrive%, starts one of the cmd files in another shell & exits. The variable %cdrom% does not exist in the new shell so the cmd file runs the find CD routine & "wineject"s the CD tray & after a predefined delay retracts the tray. It looks for the specific file file on the CD the user may have selected. If the file is not found it displays a message & ejects the CD once again, looping until the user either terminates the process or inserts the correct CD, at which point the cmd file will erase the files which were originally copied to the systemroot & del itself. The Correct CD will then autorun.

One can also leave the option of checking for the cd rom & simply end the process, leaving the PC itself to take care of the autorun for that CD.

Link to comment
Share on other sites

  • 1 month later...

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...