| 1. |
Solve : Varible Drives Unknown? |
|
Answer» Normally a pc should have a drive C: Normally a pc should have a drive C: For the network drive, you can do an IF test first. For example, if your network drive is Z:, you could do: Code: [Select]if not exist z:\ echo Network drive not found&goto :EOF echo Network drive found, running rest of batch fileI am good at confusing people today. This batch file will be put on different pc's, and I KNOW from WORKING on pc's that sometimes someone might set a local drive on a pc to E:\ instead of C:\. I have installed SCSI drives before and sometimes you cannot change the drive path of E:\ to C:\. Only 1 hard drive with an only 1 unkown directory (unknown being in your code) C:\ maybe D:\ maybe E:\ maybe etc. I am wanting to make 1 batch file to use on all of the pc's here and I would like not have to modify it because of a pc not having a drive C:\. When you have a lot of pc's to tend to sometimes you forget whos got what. What I am getting to is is there a WAY to specify an unknown local drive. If your code refers to drive C:\ and there ISNT one, only a drive E:\ I wonder if you could use an if statement to check for drive letters, or is there a better way? Hope this helpsUse the %systemdrive% variable. Try this in a batch file (or the command prompt): Code: [Select]@echo My computer is running Windows from the %systemdrive% drive.That will do the trick Your the Man!Thanks! |
|