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

Author Topic: Default \ Standard Variables  (Read 10362 times)

0 Members and 1 Guest are viewing this topic.

BatchRocks

    Topic Starter


    Hopeful
  • Thanked: 3
    Default \ Standard Variables
    « on: February 16, 2009, 05:29:25 PM »
    Does anyone know default Variables, unlike..

    Set cow = ff
    echo %cow%

    I only know OS, HomeDrive, HomePath, CD, and Random. Thanks...

    BR

    macdad-



      Expert

      Thanked: 40
      Re: Default \ Standard Variables
      « Reply #1 on: February 16, 2009, 05:40:45 PM »
      what do you mean "default variables" are you talking about variable data-types then:
      • Batch doesnt have user specified data-types, they are variant

      or are you asking about other enviroment variables like: %SYSTEMROOT%?

      Please explain more fully
      If you dont know DOS, you dont know Windows...

      Thats why Bill Gates created the Windows NT Family.

      BatchRocks

        Topic Starter


        Hopeful
      • Thanked: 3
        Re: Default \ Standard Variables
        « Reply #2 on: February 16, 2009, 05:43:30 PM »
        what do you mean "default variables" are you talking about variable data-types then:
        • Batch doesnt have user specified data-types, they are variant

        or are you asking about other enviroment variables like: %SYSTEMROOT%?

        Please explain more fully

        Yes, variables like SYSTEMROOT and things like that.

        Dusty



          Egghead

        • I could if she would, but she won't so I don't.
        • Thanked: 75
        • Experience: Beginner
        • OS: Windows XP
        Re: Default \ Standard Variables
        « Reply #3 on: February 16, 2009, 06:11:20 PM »
        Typed SET at the Command Prompt?
        One good deed is worth more than a year of good intentions.

        BatchFileCommand



          Hopeful
        • Thanked: 1
          Re: Default \ Standard Variables
          « Reply #4 on: February 16, 2009, 06:12:02 PM »
          Here's a list



          Code: [Select]
          ALLUSERSPROFILE=C:\ProgramData
          APPDATA=C:\Users\David\AppData\Roaming
          CLASSPATH=.;C:\Program Files\Java\jre1.6.0\lib\ext\QTJava.zip
          CommonProgramFiles=C:\Program Files\Common Files
          COMPUTERNAME=LAPTOPCOMPUTER
          ComSpec=C:\Windows\system32\cmd.exe
          FP_NO_HOST_CHECK=NO
          HOMEDRIVE=C:
          HOMEPATH=\Users\David
          INCLUDE=C:\Program Files\Microsoft Visual Studio .NET 2003\SDK
          LIB=C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.
          LOCALAPPDATA=C:\Users\David\AppData\Local
          LOGONSERVER=\\LAPTOPCOMPUTER
          NUMBER_OF_PROCESSORS=2
          OS=Windows_NT
          Path=C:\Perl\site\bin;C:\Perl\bin;C:\Windows\system32;C:\Windo
          \;
          PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
          PROCESSOR_ARCHITECTURE=x86
          PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 13, Genuin
          PROCESSOR_LEVEL=6
          PROCESSOR_REVISION=0f0d
          ProgramData=C:\ProgramData
          ProgramFiles=C:\Program Files
          PROMPT=$P$G
          PUBLIC=C:\Users\Public
          SESSIONNAME=Console
          SystemDrive=C:
          SystemRoot=C:\Windows
          TEMP=C:\Users\David\AppData\Local\Temp
          TMP=C:\Users\David\AppData\Local\Temp
          USERDOMAIN=LaptopComputer
          USERNAME=David
          USERPROFILE=C:\Users\David
          windir=C:\Windows


          There's a list I got when I typed set. It showed me all the system variables. You might not have all these variables.
          οτη άβγαλτος μεταφ βαθμολογία

          BatchRocks

            Topic Starter


            Hopeful
          • Thanked: 3
            Re: Default \ Standard Variables
            « Reply #5 on: February 16, 2009, 06:13:38 PM »
            Here's a list



            Code: [Select]
            ALLUSERSPROFILE=C:\ProgramData
            APPDATA=C:\Users\David\AppData\Roaming
            CLASSPATH=.;C:\Program Files\Java\jre1.6.0\lib\ext\QTJava.zip
            CommonProgramFiles=C:\Program Files\Common Files
            COMPUTERNAME=LAPTOPCOMPUTER
            ComSpec=C:\Windows\system32\cmd.exe
            FP_NO_HOST_CHECK=NO
            HOMEDRIVE=C:
            HOMEPATH=\Users\David
            INCLUDE=C:\Program Files\Microsoft Visual Studio .NET 2003\SDK
            LIB=C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.
            LOCALAPPDATA=C:\Users\David\AppData\Local
            LOGONSERVER=\\LAPTOPCOMPUTER
            NUMBER_OF_PROCESSORS=2
            OS=Windows_NT
            Path=C:\Perl\site\bin;C:\Perl\bin;C:\Windows\system32;C:\Windo
            \;
            PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
            PROCESSOR_ARCHITECTURE=x86
            PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 13, Genuin
            PROCESSOR_LEVEL=6
            PROCESSOR_REVISION=0f0d
            ProgramData=C:\ProgramData
            ProgramFiles=C:\Program Files
            PROMPT=$P$G
            PUBLIC=C:\Users\Public
            SESSIONNAME=Console
            SystemDrive=C:
            SystemRoot=C:\Windows
            TEMP=C:\Users\David\AppData\Local\Temp
            TMP=C:\Users\David\AppData\Local\Temp
            USERDOMAIN=LaptopComputer
            USERNAME=David
            USERPROFILE=C:\Users\David
            windir=C:\Windows


            There's a list I got when I typed set. It showed me all the system variables. You might not have all these variables.

            You're freaky...*Stares suspicously*

            Thanks! Lols.

            BatchFileCommand



              Hopeful
            • Thanked: 1
              Re: Default \ Standard Variables
              « Reply #6 on: February 16, 2009, 06:23:15 PM »
              Not like I memorized all of those  ::).
              οτη άβγαλτος μεταφ βαθμολογία

              macdad-



                Expert

                Thanked: 40
                Re: Default \ Standard Variables
                « Reply #7 on: February 16, 2009, 06:24:40 PM »
                learned something new: USERNAME
                this will be more helpful in my next batch program.
                If you dont know DOS, you dont know Windows...

                Thats why Bill Gates created the Windows NT Family.

                BatchFileCommand



                  Hopeful
                • Thanked: 1
                  Re: Default \ Standard Variables
                  « Reply #8 on: February 16, 2009, 06:48:21 PM »
                  %homepath% or %homeprofile% are very useful. They give the paths to the user profile.
                  οτη άβγαλτος μεταφ βαθμολογία

                  GuruGary



                    Adviser
                    Re: Default \ Standard Variables
                    « Reply #9 on: February 16, 2009, 10:18:53 PM »
                    There are some that don't show up in the SET command, like the dynamic variables and a few others including:

                    %cd%
                    %date%
                    %time%
                    %random%
                    %cmdcmdline%
                    %cmdextversion%
                    %errorlevel%
                    %=exitcode%

                    BatchRocks

                      Topic Starter


                      Hopeful
                    • Thanked: 3
                      Re: Default \ Standard Variables
                      « Reply #10 on: February 17, 2009, 09:01:18 AM »
                      Thanks Gary, I knew about Errorlevel, but it just slipped my mind :O!

                      macdad-



                        Expert

                        Thanked: 40
                        Re: Default \ Standard Variables
                        « Reply #11 on: February 17, 2009, 12:06:36 PM »
                        forgot how to get a random number between 0 and what ever number
                        i kno you have to use %Random%
                        If you dont know DOS, you dont know Windows...

                        Thats why Bill Gates created the Windows NT Family.

                        BatchRocks

                          Topic Starter


                          Hopeful
                        • Thanked: 3
                          Re: Default \ Standard Variables
                          « Reply #12 on: February 17, 2009, 12:19:35 PM »
                          forgot how to get a random number between 0 and what ever number
                          i kno you have to use %Random%

                          Isn't it:

                          Code: [Select]
                          set random=%%9
                          ?

                          Dias de verano

                          • Guest
                          Re: Default \ Standard Variables
                          « Reply #13 on: February 17, 2009, 12:26:57 PM »
                          forgot how to get a random number between 0 and what ever number
                          i kno you have to use %Random%

                          Code: [Select]
                          set /a number=(%random% %% N) + 1
                          will give a randum number between 1 and N inclusive



                          Dias de verano

                          • Guest
                          Re: Default \ Standard Variables
                          « Reply #14 on: February 17, 2009, 12:27:44 PM »
                          forgot how to get a random number between 0 and what ever number
                          i kno you have to use %Random%

                          Isn't it:

                          Code: [Select]
                          set random=%%9
                          ?

                          No. A good motto: Research first, then post.  ::)