| 1. |
Solve : Batch file to fetch user defined file? |
|
Answer» I'm looking to make a batch file that would ask the user to enter a 2 digit number to specify what file they need. The files are located in a shared folder with each file located in a folder named XXXXXX## with the ##'s representing the 2 digits I would want the user to enter. I can cover the rest as far as fetching the files and where to put them etc. Here's a simple way that works on all versions of DOSActually, the parenthesis grouping in an IF statement is not SUPPORTED in DOS 6.x and older or Windows 9x. Dam1an: What version of DOS are your users running? If it is Windows 2000 / XP / 2003 / VISTA you can try something like this: Code: [Select]echo off set /p number=Please enter the 2-digit code for your file: echo The directory specified is xxxxxx%number% You may want to add more error checking, but I THINK that is the basics of what you want.How do you see version number? All I see is Microsoft(R) Windows NT(TM) (C) Copyright 1985-1996 Microsoft Corp. Mac Thank you GuruGary, that WORKED great. QBasicMac: You can use the VER command to tell the DOS version. If it is really DOS, it will return a string like MS-DOS Version 6.22. If it is a command processor running under Windows it will return a string like Microsoft Windows 2000 [Version 5.00.2195]. You can also look up the version of your command processor extensions (under supported operating systems) with the command: Code: [Select]echo %cmdextversion% Dam1an: Glad it worked |
|