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

Author Topic: How do i make a CMD Prompt..??  (Read 7894 times)

0 Members and 1 Guest are viewing this topic.

gumbaz

    Topic Starter


    Intermediate

    How do i make a CMD Prompt..??
    « on: May 01, 2009, 08:39:16 PM »
    I need to make a prompt in my BAT Script to ask for a Directory Location and then set that location as a variable.. how can i do this..??

    gh0std0g74



      Apprentice

      Thanked: 37
      Re: How do i make a CMD Prompt..??
      « Reply #1 on: May 01, 2009, 09:21:14 PM »
      you have 180 posts, i seriously doubt you can't do it yourself by now. why don't you try your best?

      gumbaz

        Topic Starter


        Intermediate

        Re: How do i make a CMD Prompt..??
        « Reply #2 on: May 01, 2009, 09:47:48 PM »
        what functions or whatever, am i suppose yo use..??

        Dias de verano

        • Guest
        Re: How do i make a CMD Prompt..??
        « Reply #3 on: May 02, 2009, 12:12:07 AM »
        After 180 posts, gumbaz, you lose the magic "I am a n00b" card.

        billrich

        • Guest
        Re: How do i make a CMD Prompt..??
        « Reply #4 on: May 02, 2009, 02:50:14 AM »
        Start, run [ cmd ]
        or

        start, All Programs, Accessories, click Command Prompt
        or

        While at the Command Prompt, type cmd



        C:\>type old.bat
        Code: [Select]
        @echo off
        REM  Variables are Global unless declared Local
        set OLDDIR=%CD%
        echo Hello
        cmd /c
        echo new prompt
        cd %systemroot%
        echo CD  %CD%
        echo OldDir  %OLDDIR%
        echo return to old prompt
        echo CD  %CD%
        cd %HOMEPATH%
        echo %CD%
        chdir /d %OLDDIR% &rem restore current directory
        echo OldDir  %OLDDIR%
        Output:

        C:\>old.bat
        Quote
        Hello
        new prompt
        CD  C:\WINDOWS
        OldDir  C:\
        return to old prompt
        CD  C:\WINDOWS
        C:\Documents and Settings\Bill Richardson
        OldDir  C:\
        C:\>
        « Last Edit: May 02, 2009, 10:54:21 AM by billrich »

        billrich

        • Guest
        Re: How do i make a CMD Prompt..??
        « Reply #5 on: May 02, 2009, 02:53:23 AM »

        C:\>cmd /?
        Starts a new instance of the Windows XP command interpreter

        CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF]
            [[/S] [/C | /K] string]

        /C      Carries out the command specified by string and then terminates
        /K      Carries out the command specified by string but remains
        /S      Modifies the treatment of string after /C or /K (see below)
        /Q      Turns echo off
        /D      Disable execution of AutoRun commands from registry (see below)
        /A      Causes the output of internal commands to a pipe or file to be ANSI
        /U      Causes the output of internal commands to a pipe or file to be
                Unicode
        /T:fg   Sets the foreground/background colors (see COLOR /? for more info)
        /E:ON   Enable command extensions (see below)
        /E:OFF  Disable command extensions (see below)
        /F:ON   Enable file and directory name completion characters (see below)
        /F:OFF  Disable file and directory name completion characters (see below)
        /V:ON   Enable delayed environment variable expansion using ! as the
                delimiter. For example, /V:ON would allow !var! to expand the
                variable var at execution time.  The var syntax expands variables
                at input time, which is quite a different thing when inside of a FOR
                loop.
        /V:OFF  Disable delayed environment expansion.

        Note that multiple commands separated by the command separator '&&'
        are accepted for string if surrounded by quotes.  Also, for compatibility
        reasons, /X is the same as /E:ON, /Y is the same as /E:OFF and /R is the
        same as /C.  Any other switches are ignored.

        If /C or /K is specified, then the remainder of the command line after
        the switch is processed as a command line, where the following logic is
        used to process quote (") characters:

            1.  If all of the following conditions are met, then quote characters
                on the command line are preserved:

                - no /S switch
                - exactly two quote characters
                - no special characters between the two quote characters,
                  where special is one of: &<>()@^|
        Press any key to continue . . .

        Dias de verano

        • Guest
        Re: How do i make a CMD Prompt..??
        « Reply #6 on: May 02, 2009, 02:53:29 AM »
        Billrich clearly didn't read gumbaz's question properly.


        Carbon Dudeoxide

        • Global Moderator

        • Mastermind
        • Thanked: 169
          • Yes
          • Yes
          • Yes
        • Certifications: List
        • Experience: Guru
        • OS: Mac OS
        Re: How do i make a CMD Prompt..??
        « Reply #7 on: May 02, 2009, 03:54:24 AM »
        A high post count does not mean you know more than everyone else.

        Dias de verano

        • Guest
        Re: How do i make a CMD Prompt..??
        « Reply #8 on: May 02, 2009, 04:23:39 AM »
        A high post count does not mean you know more than everyone else.

        Was that directed at me?

        Carbon Dudeoxide

        • Global Moderator

        • Mastermind
        • Thanked: 169
          • Yes
          • Yes
          • Yes
        • Certifications: List
        • Experience: Guru
        • OS: Mac OS
        Re: How do i make a CMD Prompt..??
        « Reply #9 on: May 02, 2009, 04:24:51 AM »

        Dias de verano

        • Guest
        Re: How do i make a CMD Prompt..??
        « Reply #10 on: May 02, 2009, 04:26:30 AM »
        Not you, no.

        I hoped not. Please forgive me for misjudging you.

        gh0std0g74



          Apprentice

          Thanked: 37
          Re: How do i make a CMD Prompt..??
          « Reply #11 on: May 02, 2009, 05:49:47 AM »
          who cares about post count ?

          Dias de verano

          • Guest
          Re: How do i make a CMD Prompt..??
          « Reply #12 on: May 02, 2009, 05:55:28 AM »
          who cares about post count ?

          It may be relevant in making certain assessments regarding a poster.

          Carbon Dudeoxide

          • Global Moderator

          • Mastermind
          • Thanked: 169
            • Yes
            • Yes
            • Yes
          • Certifications: List
          • Experience: Guru
          • OS: Mac OS
          Re: How do i make a CMD Prompt..??
          « Reply #13 on: May 02, 2009, 05:58:41 AM »
          who cares about post count ?

          you have 180 posts, i seriously doubt you can't do it yourself by now. why don't you try your best?

          macdad-



            Expert

            Thanked: 40
            Re: How do i make a CMD Prompt..??
            « Reply #14 on: May 02, 2009, 06:00:43 AM »
            Gumbaz,

            Code: [Select]
            @echo off
            echo Please enter a directory:
            set /p indir=
             ;)

            Hope this helps
            ,Nick(macdad-)
            If you dont know DOS, you dont know Windows...

            Thats why Bill Gates created the Windows NT Family.

            gh0std0g74



              Apprentice

              Thanked: 37
              Re: How do i make a CMD Prompt..??
              « Reply #15 on: May 02, 2009, 07:12:34 AM »


              maybe i should rephrase to
               "@OP , you have asked alot on batch previously and i am sure you can find the answer from those posts. why don't you try your best? "

              fat_basterd21



                Apprentice

                Thanked: 15
              • Experience: Experienced
              • OS: Windows Vista
              Re: How do i make a CMD Prompt..??
              « Reply #16 on: May 04, 2009, 09:53:07 AM »
              How about one person solved the problem with half the effort three put into talking about post counts.

              Sometimes it would be easier just to ignore the post or repeat yourself.
              CAPS LOCK IS CRUISE-CONTROL FOR COOL!!!

              Dias de verano

              • Guest
              Re: How do i make a CMD Prompt..??
              « Reply #17 on: May 04, 2009, 11:45:00 AM »
              How about one person solved the problem with half the effort three put into talking about post counts.

              Sometimes it would be easier just to ignore the post or repeat yourself.

              How about nothing. Dickhead screen name.  ::)

              macdad-



                Expert

                Thanked: 40
                Re: How do i make a CMD Prompt..??
                « Reply #18 on: May 04, 2009, 11:46:42 AM »
                Yes FB, please change your screen name.

                And also please don't be a hypocrite.
                If you dont know DOS, you dont know Windows...

                Thats why Bill Gates created the Windows NT Family.

                fat_basterd21



                  Apprentice

                  Thanked: 15
                • Experience: Experienced
                • OS: Windows Vista
                Re: How do i make a CMD Prompt..??
                « Reply #19 on: May 04, 2009, 07:50:35 PM »
                well I've had my dickhead screen name for about 4 years now sorry nobody was ever offended before. And how am I a hypocrite? I try to answer questions not tell people to think harder...

                I wasn't trying to be rude, just stating you could have answerd the poster the first time with less effort and the lack of rudeness...
                « Last Edit: May 04, 2009, 08:02:47 PM by fat_basterd21 »
                CAPS LOCK IS CRUISE-CONTROL FOR COOL!!!

                fat_basterd21



                  Apprentice

                  Thanked: 15
                • Experience: Experienced
                • OS: Windows Vista
                Re: How do i make a CMD Prompt..??
                « Reply #20 on: May 04, 2009, 08:09:14 PM »
                Correction, the last post of mine I could find

                on: July 17, 2006, 01:58:01 PM

                Also I'm offended that anyone is offended by such a funny comedy. Add this line to your .bat file

                tskill whine.exe
                CAPS LOCK IS CRUISE-CONTROL FOR COOL!!!

                macdad-



                  Expert

                  Thanked: 40
                  Re: How do i make a CMD Prompt..??
                  « Reply #21 on: May 05, 2009, 06:18:00 AM »
                  FB,

                  Your being a hypocrite by this number:

                  How about one person solved the problem with half the effort three put into talking about post counts.

                  Sometimes it would be easier just to ignore the post or repeat yourself.

                  And you didn't help worth a darn and this is just pointless:
                  tskill whine.exe
                  If you dont know DOS, you dont know Windows...

                  Thats why Bill Gates created the Windows NT Family.

                  Dias de verano

                  • Guest
                  Re: How do i make a CMD Prompt..??
                  « Reply #22 on: May 05, 2009, 09:51:50 AM »
                  don't waste your energy, macdad, it isn't worth it.

                  fat_basterd21



                    Apprentice

                    Thanked: 15
                  • Experience: Experienced
                  • OS: Windows Vista
                  Re: How do i make a CMD Prompt..??
                  « Reply #23 on: May 06, 2009, 05:43:18 PM »
                  I think my first post was helpful in saying, if all you wanna do is whine about how you already told them in another post your better off to just ignore the post. Or if you would have taken one step further and linked it to an original post while pointing out this is a repeat, fine. "Think harder" is hardly worth posting and is frustrating for the poster. I hope this "Helps" other people to use their head before being an *censored* in the future!
                  CAPS LOCK IS CRUISE-CONTROL FOR COOL!!!

                  Dias de verano

                  • Guest
                  Re: How do i make a CMD Prompt..??
                  « Reply #24 on: May 07, 2009, 10:19:36 AM »
                  Can the abusive language, F_B21.

                  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: How do i make a CMD Prompt..??
                  « Reply #25 on: May 07, 2009, 10:35:35 AM »
                  If all you wanna do is whine about how you already told them in another post your better off to just ignore the post.

                  err...


                  didn't you already say that in another post? And now your basically whining about that here?


                  I was trying to dereference Null Pointers before it was cool.

                  Carbon Dudeoxide

                  • Global Moderator

                  • Mastermind
                  • Thanked: 169
                    • Yes
                    • Yes
                    • Yes
                  • Certifications: List
                  • Experience: Guru
                  • OS: Mac OS
                  Re: How do i make a CMD Prompt..??
                  « Reply #26 on: May 07, 2009, 10:38:40 AM »
                  Unfortunately, all the whining ends here. This topic need not continue.

                  Settle the matter elsewhere, guys. That's what PMs are for.

                  Topic Closed.