Results 1 to 2 of 2

Thread: Possible batch file help

  1. #1
    Join Date
    Feb 2009
    Location
    Indiana
    Beans
    27
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Exclamation Possible batch file help

    Not sure if anyone can help.

    But I have a program I would like to run on a thumb drive.

    It has a ini file that sets its local variables for the time set and run.

    I would like to have a batch file to substitute its variables used to run at run time so it can be universal. THe program is C++

    I have so far these 2 codes
    __________________________________________________ ____
    c.bat

    @echo off
    set pathDrive=%cd:~0,2%

    set pathConf=%pathDrive%\PortableApps\dev-c++4\devcpp.ini
    set BinDir=%pathDrive%"\PortableApps\dev-c++4\Bin\"
    set CDir=%pathDrive%"\PortableApps\dev-c++4\Include\"
    set CppDir=%pathDrive%"\PortableApps\dev-c++4\Include\G++";%pathDrive%"\PortableApps\dev-c++4\Include\"
    set LibDir=%pathDrive%"\PortableApps\dev-c++4\Lib\"
    set devcpppath=%pathDrive%\PortableApps\dev-c++4\devcpp.exe
    echo BinDir="%BinDir%">>%pathConf%

    echo.>> %pathConf%
    echo CDir="%CDir%">>%pathConf%

    echo.>> %pathConf%
    echo CppDir="%CppDir%">>%pathConf%

    echo.>> %pathConf%
    echo LibDir="%LibDir%">>%pathConf%

    echo.>> %pathConf%
    start %devcpppath%
    _______________________________________
    the ini of c++ the section that needs to be substituted

    [Directories]
    BinDir=F:\PortableApps\dev-c++4\Bin\
    CDir=F:\PortableApps\dev-c++4\Include\
    CppDir=F:\PortableApps\dev-c++4\Include\G++;F:\PortableApps\dev-c++4\Include\
    LibDir=F:\PortableApps\dev-c++4\Lib\

    when I run it withou the ini being modded it runs the app but says it can create the runtime environment of default stuff

  2. #2
    Join Date
    Apr 2009
    Location
    Midwest, U.S.A.
    Beans
    1,209
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Possible batch file help

    'Batch' files are ms-dos/windows specific. Don't confuse batch executables with 'bash' executables.

    Bash, is the bourne again shell used by default in ubuntu. It has different variable naming conventions than batch files. It looks like your batch file is NOT compatible with bash.
    Laptop: Dell Inspiron 8200 - Fedora 13 - Goddard
    Desktop: Self-Built - [Ku, Lu, Xu, U]buntu - Lucid 10.04.3 (LTS)
    Linux User: 498249 / Ubuntu User: 29241

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •