Computing.Net > Forums > Programming > Batch file to find drive letter

Batch file to find drive letter

Reply to Message Icon

Original Message
Name: JordanVash
Date: July 11, 2007 at 13:30:04 Pacific
Subject: Batch file to find drive letter
OS: XP
CPU/Ram: 2gig
Comment:

How would i go about from executing a batch file that finds your primary drive letter. Its like %SystemDrive%. But how would i execute that so it echo's it back to me?


Report Offensive Message For Removal


Response Number 1
Name: tonysathre
Date: July 11, 2007 at 14:32:54 Pacific
Subject: Batch file to find drive letter
Reply: (edit)

Everything you need is in your post.

@echo off
Echo You primary drive is %systemdrive%
pause


"Computer security." — Oxymoron


Report Offensive Follow Up For Removal

Response Number 2
Name: JordanVash
Date: July 11, 2007 at 17:41:08 Pacific
Subject: Batch file to find drive letter
Reply: (edit)

not what i meant , how do i GOTO that drive if its not C:\

i cant cd\ to it.


Report Offensive Follow Up For Removal

Response Number 3
Name: Guy
Date: July 11, 2007 at 18:08:09 Pacific
Subject: Batch file to find drive letter
Reply: (edit)

If you have e.g. E:, you just issue the command:

E:

that 'logs you to E:'.

Then you can 'cd' around that drive all you want.

That help?


Report Offensive Follow Up For Removal

Response Number 4
Name: tonysathre
Date: July 11, 2007 at 23:38:36 Pacific
Subject: Batch file to find drive letter
Reply: (edit)

Or

cd /d drive:\path

"Computer security." — Oxymoron


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Batch file to find drive letter

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge