Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Command Parameter Batch File
Name: jiko Date: October 2, 2005 at 12:15:08 Pacific OS: Windows XP 5.1.2600 CPU/Ram: Dell 3GB, 512 RAM
Comment:
I am trying to create a Command Prompt Batch file that allows you to get a directory listing for typing in the drive letter after the batch file name at the prompt. E.g. choose.bat a: would give you the directory of A:\. I would like it to do this for 3 Directories(C:\, C:\Windows, A:\) So far I have it only doing C:\.
This is what I have so far any help or suggestions would be appreciated.
@echo off if not c==1%c goto PRINT echo You must enter a parameter after the batch file name Echo. Echo. Echo Directory of C:\, Directory of C:\Windows, Directory of A:\ goto End :Print dir C: /p Echo You are in my Directory [C:\] :End
Name: dtech10 Date: October 2, 2005 at 13:46:14 Pacific
Reply:
hi
@echo off if "%1"=="c:" set Drive=%1 if "%1"=="windows" set Drive=c:\%1 if "%1"=="a:" set Drive=%1 if "%Drive%"=="" ( echo Usage Test.bat [a:] [c:] [windows] ) else ( cd %Drive% dir %Drive% ) set Drive=
0
Response Number 2
Name: jiko Date: October 2, 2005 at 17:21:42 Pacific
Reply:
Hey dtech10,
That was exactly what I was looking for. Thanks so much for the help.
Summary: I enter 2 DOS command i2 batch file. Now I want to execute the 2nd one after the first command end. Suppose my example: @echo off 1) ntbackup backup "\\BD1026658\c$\Documents and Settings\wb188580\My...
Summary: Hi, I have several batch files that I need to create for school that I am having problems with I was wondering if anyone would be able to help. 4. Create and save in the root of your floppy a batch fi...
Summary: I know that there is a "start" command in batch files but is there a way to make a batch file close a folder or a program? Please help! From Guitargraham...