?
Solved

Dos Bat File

Posted on 2013-06-10
5
Medium Priority
?
443 Views
Last Modified: 2013-06-10
I dont understand why this is not working?
Section :MM is working
The userinp is working and grabs A1
"%USERNAME%" == "xxxxxx"  is working
but line 29 does not go to CT
it goes to line 35 to TB the first group
what am I missing - LOL its driving me crazy


@echo off

:MM
cls
echo Select the Database to Download
echo ----------------------
echo  1 BEQ
echo  2 TRR
echo  3 AUDIT
echo  4 COMM AUDIT
echo  5 COB
echo  6 FEF
echo  7 LISLEP
echo  8 BEQ HS
echo  9 PDE
echo 10 MASTER
echo --------------------
echo E Exit this menu

set /p userinp=User Input:
set userinp=%userinp:~0,1%
if "%userinp%"=="1" goto A1
if "%userinp%"=="2" goto A2
if "%userinp%"=="3" goto A3
if "%userinp%"=="E" goto A0
echo Invalid Choice

:A1
if "%USERNAME%" == "xxxxxx" goTo CT
if "%USERNAME%" == "yyyyyy" goto TB
if "%USERNAME%" == "zzzzzz" goto BW

echo Downloading BEQ .....

:TB
  DEL  "C:\ERPDP\BEQ\TSO-BEQ DatabaseTB.zip"
  COPY "\\PYWNAP001\Senior_Seg\ERPDP_Operations\Databases\BEQ\TSO-BEQ DatabaseTB.zip"         "C:\ERPDP\BEQ"
  Pause
  goto MM
:BW
  DEL  "C:\ERPDP\BEQ\TSO-BEQ DatabaseBW.zip"
  COPY "\\PYWNAP001\Senior_Seg\ERPDP_Operations\Databases\BEQ\TSO-BEQ DatabaseBW.zip"         "C:\ERPDP\BEQ"
  goto MM      

:CT
  DEL  "C:\ERPDP\BEQ\TSO-BEQ Database.mdb"
  COPY "\\PYWNAP001\Senior_Seg\ERPDP_Operations\Databases\BEQ\TSO-BEQ Database.mdb"           "C:\ERPDP\BEQ"
  goto MM      

:A0
echo Exitting, Have a Good Day ........
0
Comment
Question by:Stephen Roesner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 39235806
I would change it to read...

:A1
echo "%USERNAME%"
if "%USERNAME%" == "xxxxxx" goTo CT
if "%USERNAME%" == "yyyyyy" goto TB
if "%USERNAME%" == "zzzzzz" goto BW


...just to be sure.
0
 
LVL 57

Accepted Solution

by:
HainKurt earned 1200 total points
ID: 39235996
it should work fine, but maybe you should add a pause before "goto MM" to see its working...
also, maybe user is not "xxxxxx"
0
 

Author Comment

by:Stephen Roesner
ID: 39236021
Good catch i was using a small c instead of a cap C it now works I didn't realize dos was case sensitive
0
 

Author Comment

by:Stephen Roesner
ID: 39236032
I've requested that this question be closed as follows:

Accepted answer: 0 points for Grizbear51's comment #a39236021

for the following reason:

Good catch i was using a small c instead of a cap C it now works I didn't realize dos was case sensitive
0
 

Author Closing Comment

by:Stephen Roesner
ID: 39236033
Good catch i was using a small c instead of a cap C it now works I didn't realize dos was case sensitive
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question