MS-DOS

Moderators: blip
Number of threads: 389
Number of posts: 904

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Re: unable to set variable in DOS batch file Posted by anthrax11 on 25 Aug 2009 at 2:41 AM
There are two practical ways to pass variables to batch files, either by parameters(%1, %2) or by environment variables(%PATH%, etc.), which is what you seem to be doing. In linux scripts and several programming languages(Perl, PHP), variables are referred to with the $ prefix. In batch files(.bat), variables are referred to by double percent signs and the dollar sign has a completely different meaning.

What's confusing is you're saying it's a DOS batch file. I don't know if you're confusing it for a linux shell script or a windows batch script, but what I know is that there is no MySQL for DOS. You said using dollar signs around MYSQL_PATH fixed the first problem, so why does that suddenly not work now?
Thread Tree
nirvan unable to set variable in DOS batch file on 22 Aug 2009 at 3:11 PM
anthrax11 Re: unable to set variable in DOS batch file on 23 Aug 2009 at 6:01 AM
nirvan Re: unable to set variable in DOS batch file on 23 Aug 2009 at 9:38 PM
nirvan Re: unable to set variable in DOS batch file on 23 Aug 2009 at 9:39 PM
anthrax11 Re: unable to set variable in DOS batch file on 24 Aug 2009 at 2:24 AM
nirvan Re: unable to set variable in DOS batch file on 25 Aug 2009 at 1:59 AM
anthrax11 Re: unable to set variable in DOS batch file on 25 Aug 2009 at 2:41 AM
nirvan Re: unable to set variable in DOS batch file on 25 Aug 2009 at 6:50 AM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.