Search found 11 matches
- 21 Aug 2012 16:45
- Forum: DOS Batch Forum
- Topic: Need some help with a menu
- Replies: 2
- Views: 2804
Need some help with a menu
Hello all, I'm having a bit of trouble getting my menu setup to work. When I select a choice, it just gives me the "Error. Please select a valid choice" text that I setup. Can someone please tell me what's going wrong? Thanks! Here is a block of code that has the problem. :mainMenu cls ech...
- 09 Nov 2011 07:34
- Forum: DOS Batch Forum
- Topic: Finding the directory name
- Replies: 3
- Views: 4453
Re: Finding the directory name
To find the user @ECHO OFF ECHO %USERNAME% ECHO %USERPROFILE% PAUSE To find the location of the batch file @ECHO OFF ECHO %~DP0 PAUSE Okay so I get the first one. That make sense. But when I try the second one, it doesn't work. I type in "echo %~DPO" but it just returns with %~DPO. Any he...
- 08 Nov 2011 17:21
- Forum: DOS Batch Forum
- Topic: Please list useful administrative commands to learn
- Replies: 4
- Views: 5599
Re: Please list useful administrative commands to learn
What kind of commands are you looking for exactly?
- 08 Nov 2011 17:07
- Forum: DOS Batch Forum
- Topic: Finding the directory name
- Replies: 3
- Views: 4453
Finding the directory name
Hey guys, Can anyone tell me in Windows 7/Vista, how to find the name of the current user and where a certain file is located? For example: I need to know what the person's username is so I can find the C:\Users\(Name) Also, I need to know where the file that is executing (as in my batch file) where...
- 25 May 2011 09:47
- Forum: DOS Batch Forum
- Topic: Variable Question
- Replies: 14
- Views: 15443
Re: Variable Question
Also one more problem. This piece of code does not set it as the variable. set /p User_Settings_1=< C:\Comp_Diag\User\User_Settings_1.txt set /p User_Settings_2=< C:\Comp_Diag\User\User_Settings_2.txt set /p User_Settings_3=< C:\Comp_Diag\User\User_Settings_3.txt In User_Settings_1.txt I have the wo...
- 25 May 2011 04:50
- Forum: DOS Batch Forum
- Topic: Variable Question
- Replies: 14
- Views: 15443
Re: Variable Question
Incredibly helpful. Thank you. But does using %NF% work with echo Hello!%NF%How are you!? > document.txt??
Will that work?
Will that work?
- 24 May 2011 19:22
- Forum: DOS Batch Forum
- Topic: Variable Question
- Replies: 14
- Views: 15443
Re: Variable Question
Thanks! I'll be sure to download it! But I have a question about on of your previous enteries. @echo off set NLM=^ set NL=^^^%NLM%%NLM%^%NLM%%NLM% echo I love pie!%NL%A new line is here! > toast.txt In this, what is the whole set NLM=^ and set NL stuff about? It confuses me and I would like to know ...
- 24 May 2011 18:55
- Forum: DOS Batch Forum
- Topic: Variable Question
- Replies: 14
- Views: 15443
Re: Variable Question
Well thats simple... Haha thank you.
- 24 May 2011 18:48
- Forum: DOS Batch Forum
- Topic: Variable Question
- Replies: 14
- Views: 15443
Re: Variable Question
Okay. So say I have a file, "passwors.txt". This file contains the "Admin" password. Can my program,
read the contents of the file,
compare it to an existing variable,
and execute accordingly?
read the contents of the file,
compare it to an existing variable,
and execute accordingly?
- 24 May 2011 16:58
- Forum: DOS Batch Forum
- Topic: Variable Question
- Replies: 14
- Views: 15443
Re: Variable Question
That was very helpful. But one thing I am still confused on is this. By saying "echo Hello > document.txt", does that also create the document if it doesn't yet exist?
And by "read" I meant can it search for keywords in the document and execute accordingly?
And by "read" I meant can it search for keywords in the document and execute accordingly?
- 24 May 2011 15:18
- Forum: DOS Batch Forum
- Topic: Variable Question
- Replies: 14
- Views: 15443
Variable Question
Okay. So I know how to use the set /p command on a basic level of options. For example, =================================== echo 1 echo 2 echo 3 set /p choice=(Pick a number!) if not '%choice%'==set choice=%choice=~0,1% if '%choice%'=='1' goto 1 if '%choice%'=='2' goto 2 if '%choice%'=='3' goto 3 ec...