Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: another question  (Read 7005 times)

0 Members and 1 Guest are viewing this topic.

steven32collins

    Topic Starter


    Intermediate
    • Experience: Beginner
    • OS: Windows XP
    another question
    « on: January 03, 2009, 05:47:19 AM »
    how do you make a cde that will open another .bat file in note pad
    Everything should be made as simple as possible, but not simpler.
    --Albert Einstein--

    Carbon Dudeoxide

    • Global Moderator

    • Mastermind
    • Thanked: 169
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Experience: Guru
    • OS: Mac OS
    Re: another question
    « Reply #1 on: January 03, 2009, 06:05:55 AM »
    Open another batch file in Notepad? What do you mean?

    steven32collins

      Topic Starter


      Intermediate
      • Experience: Beginner
      • OS: Windows XP
      Re: another question
      « Reply #2 on: January 03, 2009, 06:23:06 AM »
      so instead of the fil opening in a cmd comand prompt window the .bat file opens up in notpad ready for editing
      Everything should be made as simple as possible, but not simpler.
      --Albert Einstein--

      Carbon Dudeoxide

      • Global Moderator

      • Mastermind
      • Thanked: 169
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Experience: Guru
      • OS: Mac OS
      Re: another question
      « Reply #3 on: January 03, 2009, 06:29:50 AM »
      Hmmmm....I don't think it's possible. What's wrong with Right Click --> Edit?

      Dias de verano

      • Guest
      Re: another question
      « Reply #4 on: January 03, 2009, 06:53:39 AM »
      Code: [Select]
      notepad "c:\batch files\batchfile.bat"

      BatchFileCommand



        Hopeful
      • Thanked: 1
        Re: another question
        « Reply #5 on: January 03, 2009, 10:06:31 AM »
        I suggest to do it this way because you can choose which file you want to open.
        Code: [Select]
        @echo off
        :start
        set /p open=What file would you like to open:
        if exist C:\Desktop\notepad\"%open%" goto next
        if not exist C:\Desktop\notepad\"%open%" goto fail

        :next
        cls
        start C:\Desktop\notepad\"%open%"
        goto start

        :fail
        cls
        msg * File not found :( .
        goto start

        I'm not sure if that will work or not. Someone correct me.

        οτη άβγαλτος μεταφ βαθμολογία

        steven32collins

          Topic Starter


          Intermediate
          • Experience: Beginner
          • OS: Windows XP
          Re: another question
          « Reply #6 on: January 04, 2009, 03:48:44 AM »
          un fortunatly that code does not work but the first posted code works fine for me because im only opening a cirtain file
          i cant spell
          Everything should be made as simple as possible, but not simpler.
          --Albert Einstein--

          BatchFileCommand



            Hopeful
          • Thanked: 1
            Re: another question
            « Reply #7 on: January 04, 2009, 08:16:43 AM »
            Woops, the code doesn't work because I got the file path wrong.
            οτη άβγαλτος μεταφ βαθμολογία

            steven32collins

              Topic Starter


              Intermediate
              • Experience: Beginner
              • OS: Windows XP
              Re: another question
              « Reply #8 on: January 05, 2009, 12:16:17 AM »
              im making a batch file for my memory sticks and that function that i just posted will alow the program to work together with the other programs on the other 3 memorysticks
              Everything should be made as simple as possible, but not simpler.
              --Albert Einstein--

              steven32collins

                Topic Starter


                Intermediate
                • Experience: Beginner
                • OS: Windows XP
                Re: another question
                « Reply #9 on: January 05, 2009, 12:21:23 AM »
                im making a batch file for my memory sticks and that function that i just posted will alow the program to work together with the other programs on the other 3 memorysticks

                woops i posted this in the wrong post
                Everything should be made as simple as possible, but not simpler.
                --Albert Einstein--

                Helpmeh



                  Guru

                • Roar.
                • Thanked: 123
                  • Yes
                  • Yes
                • Computer: Specs
                • Experience: Familiar
                • OS: Windows 8
                Re: another question
                « Reply #10 on: January 06, 2009, 05:21:48 PM »
                I suggest to do it this way because you can choose which file you want to open.
                Code: [Select]
                @echo off
                :start
                set /p open=What file would you like to open:
                if exist C:\Desktop\notepad\"%open%" goto next
                if not exist C:\Desktop\notepad\"%open%" goto fail

                :next
                cls
                start C:\Desktop\notepad\"%open%"
                goto start

                :fail
                cls
                msg * File not found :( .
                goto start

                I'm not sure if that will work or not. Someone correct me.


                The if not exist is a bit of a waste...just replace with goto fail.
                Where's MagicSpeed?
                Quote from: 'matt'
                He's playing a game called IRL. Great graphics, *censored* gameplay.

                BC_Programmer


                  Mastermind
                • Typing is no substitute for thinking.
                • Thanked: 1140
                  • Yes
                  • Yes
                  • BC-Programming.com
                • Certifications: List
                • Computer: Specs
                • Experience: Beginner
                • OS: Windows 11
                Re: another question
                « Reply #11 on: January 06, 2009, 08:43:17 PM »
                also, what if the batch file they wanted to open wasn't in the completely arbitrary C:\desktop\notepad folder?
                I was trying to dereference Null Pointers before it was cool.

                Helpmeh



                  Guru

                • Roar.
                • Thanked: 123
                  • Yes
                  • Yes
                • Computer: Specs
                • Experience: Familiar
                • OS: Windows 8
                Re: another question
                « Reply #12 on: January 07, 2009, 03:08:34 PM »
                True...You could just do it as "%open%" is the path+file in relation to the script.
                Where's MagicSpeed?
                Quote from: 'matt'
                He's playing a game called IRL. Great graphics, *censored* gameplay.

                BatchFileCommand



                  Hopeful
                • Thanked: 1
                  Re: another question
                  « Reply #13 on: January 07, 2009, 04:19:40 PM »
                  Oh yeah, you could just do

                  if exist %something% (goto next) else (goto fail)
                  οτη άβγαλτος μεταφ βαθμολογία

                  Tan_Za



                    Intermediate
                  • Starcraft and C programming
                    • Experience: Experienced
                    • OS: Windows 7
                    Re: another question
                    « Reply #14 on: January 07, 2009, 04:34:07 PM »
                    This code should work...

                    @echo off
                    title File Open
                    set/p "ch1=Program you want to use to open file: "
                    set/p "ch2=Path name of file: "
                    set/p "ch3=Name of file: "
                    echo.
                    :anz_lbl
                    echo Is this what you want?
                    echo %ch1% "%ch2%%ch3%"
                    echo If that is right type y to continue
                    set/p "anz=>"
                    if %anz% equ y goto con
                    if %anz% equ n goto exit
                    cls
                    goto anz_lbl

                    :con
                    %ch1% "%ch2%%ch3%"
                    echo Done..
                    echo any key to exit
                    pause >nul
                    cls
                    goto exit

                    :exit
                    exit

                    That should work like a breeze.
                    This also allows you to type in any program to open your file :-)

                    Tan_Za