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

Author Topic: Inserting a Blank Space Before Set /P Output  (Read 21196 times)

0 Members and 1 Guest are viewing this topic.

gregory

    Topic Starter


    Beginner

    Thanked: 1
    • Experience: Experienced
    • OS: Linux variant
    Inserting a Blank Space Before Set /P Output
    « on: March 27, 2010, 04:25:52 AM »
    How does one get a blank space to appear before the output of a set /p command?

    For example:

    Code: [Select]
    set /p var=helloThis will display hello on the line. I need a blank space to come before that.

    Thanks all.

    vilsol



      Greenhorn

      Re: Inserting a Blank Space Before Set /P Output
      « Reply #1 on: March 27, 2010, 04:54:17 AM »
      echo.

      gregory

        Topic Starter


        Beginner

        Thanked: 1
        • Experience: Experienced
        • OS: Linux variant
        Re: Inserting a Blank Space Before Set /P Output
        « Reply #2 on: March 27, 2010, 05:09:55 AM »
        Echo will display everything on the line, including "set /p var=".

        vilsol



          Greenhorn

          Re: Inserting a Blank Space Before Set /P Output
          « Reply #3 on: March 27, 2010, 05:12:14 AM »
          i said something like this
          Code: [Select]
          echo.
          set /p var=hello

          gregory

            Topic Starter


            Beginner

            Thanked: 1
            • Experience: Experienced
            • OS: Linux variant
            Re: Inserting a Blank Space Before Set /P Output
            « Reply #4 on: March 27, 2010, 05:14:58 AM »
            i said something like this
            Code: [Select]
            echo.
            set /p var=hello

            That would insert a blank line.

            Sidewinder



              Guru

              Thanked: 139
            • Experience: Familiar
            • OS: Windows 10
            Re: Inserting a Blank Space Before Set /P Output
            « Reply #5 on: March 27, 2010, 05:36:36 AM »
            The set command takes everything literally. If you want a leading space before the 'hello', insert one:

            Code: [Select]
            set /p var= Hello

            This is also true of trailing characters.

             8)
            The true sign of intelligence is not knowledge but imagination.

            -- Albert Einstein

            gregory

              Topic Starter


              Beginner

              Thanked: 1
              • Experience: Experienced
              • OS: Linux variant
              Re: Inserting a Blank Space Before Set /P Output
              « Reply #6 on: March 27, 2010, 05:38:56 AM »
              The set command takes everything literally. If you want a leading space before the 'hello', insert one:

              Code: [Select]
              set /p var= Hello

              This is also true of trailing characters.

               8)

              Funny, that doesn't work for me.

              Sidewinder



                Guru

                Thanked: 139
              • Experience: Familiar
              • OS: Windows 10
              Re: Inserting a Blank Space Before Set /P Output
              « Reply #7 on: March 27, 2010, 05:52:31 AM »
              Funny, that doesn't work for me.

              OK. Let's start at the beginning. What OS are you using? The command posted should work on NT machines either at the command line or in a batch file.

               8)
              The true sign of intelligence is not knowledge but imagination.

              -- Albert Einstein

              gregory

                Topic Starter


                Beginner

                Thanked: 1
                • Experience: Experienced
                • OS: Linux variant
                Re: Inserting a Blank Space Before Set /P Output
                « Reply #8 on: March 27, 2010, 06:02:30 AM »
                The current machine is running Vista.

                You're telling me that if you run the following code in a .cmd file it shows a space before "hello"?
                Code: [Select]
                @ echo off

                set /p var= hello

                *Edit

                Perhaps I've caused some confusion. I'm wanting a space literally displayed on the screen output.

                Sidewinder



                  Guru

                  Thanked: 139
                • Experience: Familiar
                • OS: Windows 10
                Re: Inserting a Blank Space Before Set /P Output
                « Reply #9 on: March 27, 2010, 06:27:20 AM »
                The current machine is running Vista.

                You're telling me that if you run the following code in a .cmd file it shows a space before "hello"?

                It does on XP. Note there should not be a space between the @ and echo on the first line, however it still works!

                Are you sure you're in Command prompt and not MS-DOS Prompt?

                 8)
                The true sign of intelligence is not knowledge but imagination.

                -- Albert Einstein

                gregory

                  Topic Starter


                  Beginner

                  Thanked: 1
                  • Experience: Experienced
                  • OS: Linux variant
                  Re: Inserting a Blank Space Before Set /P Output
                  « Reply #10 on: March 27, 2010, 06:38:34 AM »
                  Are you sure you're in Command prompt and not MS-DOS Prompt?

                  Yup, it's a .cmd file that executes in cmd.exe.

                  And it's certainly not working for me in Vista. Perhaps someone on Vista or 7 would be nice enough to test it out.
                  Any other thoughts? I really do appreciate the effort.

                  Sidewinder



                    Guru

                    Thanked: 139
                  • Experience: Familiar
                  • OS: Windows 10
                  Re: Inserting a Blank Space Before Set /P Output
                  « Reply #11 on: March 27, 2010, 06:46:03 AM »
                  You're right, perhaps someone with Vista will see the problem. Interesting note, a cmd file with your code runs in both the MS-DOS Prompt and the Command Prompt. At the console however it only works in Command Prompt.

                  Good luck. 8)

                  You could try closing the command window and reopening it. Sometimes just a reset will work wonders.
                  The true sign of intelligence is not knowledge but imagination.

                  -- Albert Einstein

                  Salmon Trout

                  • Guest
                  Re: Inserting a Blank Space Before Set /P Output
                  « Reply #12 on: March 27, 2010, 07:51:42 AM »
                  XP Professional SP3 32 bit

                  Code: [Select]
                  Microsoft Windows XP [Version 5.1.2600]
                  (C) Copyright 1985-2001 Microsoft Corp.

                  C:\>set /p var= hello
                   hello

                  Windows 7 Professional 64 bit

                  Code: [Select]
                  Microsoft Windows [Version 6.1.7600]
                  Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

                  C:\>set /p var= hello
                  hello

                  gregory

                    Topic Starter


                    Beginner

                    Thanked: 1
                    • Experience: Experienced
                    • OS: Linux variant
                    Re: Inserting a Blank Space Before Set /P Output
                    « Reply #13 on: March 27, 2010, 08:10:20 AM »
                    Thanks for confirming that.
                    Any idea what else could be done? :)

                    ghostdog74



                      Specialist

                      Thanked: 27
                      Re: Inserting a Blank Space Before Set /P Output
                      « Reply #14 on: March 27, 2010, 05:59:13 PM »
                      Any idea what else could be done? :)
                      sure, you can learn to use vbscript or powershell. Or get a real programming language like Perl or Python for your batch scripting needs.. they are way better than what cmd.exe can offer.

                      greg



                        Intermediate

                        Thanked: 7
                        Re: Inserting a Blank Space Before Set /P Output
                        « Reply #15 on: March 28, 2010, 04:16:03 PM »
                        sure, you can learn to use vbscript or powershell. Or get a real programming language like Perl or Python for your batch scripting needs.. they are way better than what cmd.exe can offer.

                        And you may use Assembly language:

                        "A program written in assembly language consists of a series of instructions--mnemonics that correspond to a stream of executable instructions, when translated by an assembler, that can be loaded into memory and executed.:

                        reference:  http://en.wikipedia.org/wiki/Assembly_language


                        Or

                        You may  use machine code.

                        Definition: Machine code is the name for the Instructions that a CPU can execute. It's rather difficult to read as it is just numbers in memory. There are programs that can convert the numbers back into assembly language but unless you are pretty skilled or trying to break a protection scheme, there is little use or need for it.
                        Compilers generate machine code from your C or C++ source code.

                        reference:

                        http://cplus.about.com/od/introductiontoprogramming/g/machinecodedefn.htm
                        Have a Nice Day

                        ghostdog74



                          Specialist

                          Thanked: 27
                          Re: Inserting a Blank Space Before Set /P Output
                          « Reply #16 on: March 28, 2010, 06:23:01 PM »
                          @grep, i  challenge you use assembly language to solve batch problems next time you post.

                          greg



                            Intermediate

                            Thanked: 7
                            Re: Inserting a Blank Space Before Set /P Output
                            « Reply #17 on: March 28, 2010, 06:47:26 PM »
                            Greg, I  challenge you use assembly language to solve batch problems next time you post.

                            I decline the challenge.

                            I did not say I used assembly Language. If this were 1970 and I was 30, I would accept the challenge.

                            The CH members in charge have suggested we should not import outside
                            code for the batch Board. 

                            But I enjoy your awk, sed and vbs solutions.

                            Keep posting Casper.

                             
                            Have a Nice Day

                            ghostdog74



                              Specialist

                              Thanked: 27
                              Re: Inserting a Blank Space Before Set /P Output
                              « Reply #18 on: March 28, 2010, 06:48:40 PM »
                              I decline the challenge.
                              then why did you post about assembly language? what's the message that you are trying to tell us?

                              greg



                                Intermediate

                                Thanked: 7
                                Re: Inserting a Blank Space Before Set /P Output
                                « Reply #19 on: March 28, 2010, 07:04:36 PM »
                                then why did you post about assembly language? what's the message that you are trying to tell us?

                                Maybe  the CH members in charge ( I don't mean CH staff ) are correct about importing too much strange code to a batch board.

                                The assembly language post was carrying the idea to an absurd extreme.

                                The idea was to make someone laugh.  Humor has no place at CH?

                                Have a Nice Day

                                gregory

                                  Topic Starter


                                  Beginner

                                  Thanked: 1
                                  • Experience: Experienced
                                  • OS: Linux variant
                                  Re: Inserting a Blank Space Before Set /P Output
                                  « Reply #20 on: March 29, 2010, 05:06:43 AM »
                                  How odd this has become.

                                  Geek-9pm


                                    Mastermind
                                  • Geek After Dark
                                  • Thanked: 1026
                                    • Gekk9pm bnlog
                                  • Certifications: List
                                  • Computer: Specs
                                  • Experience: Expert
                                  • OS: Windows 10
                                  Re: Inserting a Blank Space Before Set /P Output
                                  « Reply #21 on: March 29, 2010, 01:00:14 PM »
                                  This part of the forum is about using either DOS or love command prompt in windows XP, Vista  or comparable Windows operating system.
                                  Apparently the original poster wants to show a prompt with a space in front of it and then the user must enter a value and hit return. This will set the value to a variable that can be used to later in a batch file. At least that is what I understand.

                                  Perhaps it would help if the original poster could give some explanation as to why a space is needed before the prompt. For some reason I have an uncomfortable feeling that this is some kind of effort to camouflage an attack on an existing application. Otherwise, the original poster could just modify some other part of this program to make sure the space is there before the prompt. However, I have been criticized for making accusations like this. So I would like to respectfully ask the original poster. Why do you need to have a space before the prompt?

                                  And yes, it would be quite easy to come up with an assembly language or machine language solution to this problem that would require a very small amount of code. However, use of machine level code is considered to be a potential threat and is not favored by other members of this form.

                                  Salmon Trout

                                  • Guest
                                  Re: Inserting a Blank Space Before Set /P Output
                                  « Reply #22 on: March 29, 2010, 03:19:47 PM »
                                  Perhaps it would help if the original poster could give some explanation as to why a space is needed before the prompt. For some reason I have an uncomfortable feeling that this is some kind of effort to camouflage an attack on an existing application.

                                  I have wanted to do this in order to have a margin at the left side of the command window, because it looks better than starting right at the edge of the window. I used VBScript.

                                  gregory

                                    Topic Starter


                                    Beginner

                                    Thanked: 1
                                    • Experience: Experienced
                                    • OS: Linux variant
                                    Re: Inserting a Blank Space Before Set /P Output
                                    « Reply #23 on: March 29, 2010, 10:05:29 PM »
                                    Otherwise, the original poster could just modify some other part of this program to make sure the space is there before the prompt.

                                    A space before where the user will input is not a problem. However a space before the promptString is apparently impossible in Vista on up.

                                    So I would like to respectfully ask the original poster. Why do you need to have a space before the prompt?
                                    I have wanted to do this in order to have a margin at the left side of the command window, because it looks better than starting right at the edge of the window.

                                    Bingo. All of my screen output has a margin of 1 space from the left edge. All that is, except for the set /p's. >:(
                                    Nothing evil is afoot, I promise, really, nothing like that at all, for sure, cross my heart, no really, nothing like that.

                                    Geek-9pm


                                      Mastermind
                                    • Geek After Dark
                                    • Thanked: 1026
                                      • Gekk9pm bnlog
                                    • Certifications: List
                                    • Computer: Specs
                                    • Experience: Expert
                                    • OS: Windows 10
                                    Re: Inserting a Blank Space Before Set /P Output
                                    « Reply #24 on: March 29, 2010, 11:39:33 PM »
                                    Perhaps the most piratical solution is to go with PowerShell.
                                    http://support.microsoft.com/kb/926139/en-us
                                    The above link is for XP.

                                    Salmon Trout

                                    • Guest
                                    Re: Inserting a Blank Space Before Set /P Output
                                    « Reply #25 on: March 30, 2010, 04:43:33 AM »
                                    If you can download and use third party executables there is Bill Stewart's free Editvar utility. The zip contains executables and also good help text files with full usage details. One very useful feature in optional input masking.

                                    http://www.westmesatech.com/editv.html

                                    There are quite a few other handy utilities at this site.

                                    put the executable editv32.exe or editv64.exe either in the batch folder or somewhere on your PATH or put it in a folder of your choosing and use its full path in your batch e.g. "C:\My Scripts\editv32.exe" -p " Type something" Variable

                                    example batch file

                                    Code: [Select]
                                    @echo off
                                    echo (1) using set /p
                                    set Myname=
                                    echo.
                                    set /p "Myname= Enter your user name: "
                                    echo %Myname%
                                    echo.
                                    echo (2) using editvXX
                                    set Myname=
                                    echo.
                                    editv32 -p " Enter your user name: " Myname
                                    echo  %Myname%
                                    echo.
                                    echo (3) Hide input text
                                    set Myname=
                                    echo.
                                    editv32 -m -p " Enter your user name: " Myname
                                    echo  %Myname%

                                    output
                                    Code: [Select]
                                    (1) using set /p

                                    Enter your user name: Jim
                                    Jim

                                    (2) using editvXX

                                     Enter your user name: Bob
                                     Bob

                                    (3) Hide input text

                                     Enter your user name: ****
                                     Bill





                                    « Last Edit: March 30, 2010, 05:00:35 AM by Salmon Trout »

                                    ghostdog74



                                      Specialist

                                      Thanked: 27
                                      Re: Inserting a Blank Space Before Set /P Output
                                      « Reply #26 on: March 30, 2010, 05:00:07 AM »
                                      If you can download and use third party executables there is Bill Stewart's free Editvar utility. The zip contains executables and also good help text files with full usage details. One very useful feature in optional input masking.
                                      good to know. But i will stick to Python/Perl  for a well rounded scripting solution. :)

                                      Salmon Trout

                                      • Guest
                                      Re: Inserting a Blank Space Before Set /P Output
                                      « Reply #27 on: March 30, 2010, 05:04:43 AM »
                                      good to know. But i will stick to Python/Perl  for a well rounded scripting solution. :)

                                      "well rounded..." subjective view... language partisans... harrumph...

                                      My remarks were mainly addressed to the OP who requested (it seems to me) a batch solution, which has not so far been forthcoming, not that I wish to revive the old "answer the question as posed vs. suggest they try another language/OS/whatever" debate. Although I agree that suggesting other approaches can be a very helpful and positive step, sometimes an OP just wants a quick (and possibly in the eyes of some people, dirty) solution, rather than a Comp Sci lesson.


                                      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: Inserting a Blank Space Before Set /P Output
                                      « Reply #28 on: March 30, 2010, 07:18:06 AM »
                                      sometimes an OP just wants a quick (and possibly in the eyes of some people, dirty) solution, rather than a Comp Sci lesson.

                                      Exactly.

                                      In fact I'm surprised there aren't code architects here that try to post some full-featured Object-hierarchy for every single problem.

                                      "And then you simply need to derive a new class from this particular CTextWithaSpaceInFrontOfIt base class, and then return the text to output in the overridden WriteText() Method. Also don't forget to set the ReturnFormatter property to an instance of an object that implements the IReturnFormatter interface. You can use the CReturnFormatter class for this if necessary, it performs default handing of IReturnFormatter by not formatting anything at all."

                                      A lot of people, when they take their car into the shop, they really don't care that their Alternator Selenoid needs topping up or that there is a leak in their carburetor or what is causing their problems. That's why they went to the shop, to fix whatever is wrong.

                                      Not everybody can be an expert in everything; many Posters here have no intention of getting into programming and are merely trying to do their job; while, as Salmon Trout says, it does no harm to suggest other alternatives like Python/Perl, When you reference it time and time again in repeated posts afterward even after the OP has expressed disinterest in the solution just makes you look like a hard-headed evangelist. Python and Perl are programming languages. They are no worse nor no better overall then any other. No Programming language has <everything> you could ever need. Sure Python/Perl have modules you can use for nearly everything; so does VBScript. It's called COM. and COM components are a lot easier to use from VBScript as compared to either Python or Perl (which in themselves need a module for this purpose), why? because VBScript was designed solely as a glue language, and specifically as a consumer of these COM components. Python/Perl were not designed with the ability to use COM components; they still can, if you know the proper Voodoo. (and god forbid you have to deal with COM errors in either one)

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

                                      Salmon Trout

                                      • Guest
                                      Re: Inserting a Blank Space Before Set /P Output
                                      « Reply #29 on: March 30, 2010, 07:23:30 AM »
                                      When you reference it time and time again in repeated posts afterward even after the OP has expressed disinterest in the solution just makes you look like a hard-headed evangelist.

                                      Or a show-off, somebody who likes to feel like a big fish so seeks out small ponds to splash around in. Not that I have anybody in particular in mind.



                                      ghostdog74



                                        Specialist

                                        Thanked: 27
                                        Re: Inserting a Blank Space Before Set /P Output
                                        « Reply #30 on: March 30, 2010, 08:12:54 AM »
                                        Sure Python/Perl have modules you can use for nearly everything; so does VBScript. It's called COM. and COM components are a lot easier to use from VBScript as compared to either Python or Perl
                                        that is not true. If one really have extensive experience with Python/Perl, you will know there are too many things vbscript cannot compare. Find me a FTP module in vbscript that does file transfer, or secure file transfer(SSH). Or find me a good compression library that supports widely used compression algorithm in vbscript. Data structures in Perl/Python are much easier to use than those in vbscript, and more flexible. How about a sorting function in vbscript? till now, i don't see very good support on sorting. And how about emailing mechanism or the ability to do network/socket programming easily? How about a library for HTML/XML parsing or a library to grab a web page that also supports proxy authentication or SSL?

                                        Python/Perl already has extensive support for such things. COM? you might be surprised that Perl/Python supports COM as well.

                                        How about portability of code? Python/Perl scripts works in Mac,*nix. Is vbscript portable?

                                        I use vbscript as well and i have no problem coding with it when the situation needs, but if i have a choice on language to use on a production project, it will not be vbscript

                                        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: Inserting a Blank Space Before Set /P Output
                                        « Reply #31 on: March 30, 2010, 08:40:39 AM »
                                        Find me a FTP module in vbscript that does file transfer, or secure file transfer(SSH).
                                        http://www.chilkatsoft.com/FTP-ActiveX.asp

                                        Quote
                                        Or find me a good compression library that supports widely used compression algorithm in vbscript.
                                        Google gives me 126,000 hits for "ActiveX Compression Library"

                                        Quote
                                        Data structures in Perl/Python are much easier to use than those in vbscript, and more flexible.
                                        All accessible via COM... or just create them yourself in VBScript classes. Seriously, you write them once, and you can reuse them. there doesn't HAVE to be a bloody module for every single god damned thing you mgiht want to use.

                                        Quote
                                        How about a sorting function in vbscript? till now, i don't see very good support on sorting.
                                        Again: a case of roll your own. Writing a sorting routine is easy. This hardly even counts.

                                        Quote
                                        And how about emailing mechanism or the ability to do network/socket programming easily?
                                        CDO. WinSock Control/Library.
                                        Quote
                                        How about a library for HTML/XML parsing
                                        MSXML.

                                        Quote
                                        or a library to grab a web page that also supports proxy authentication or SSL?
                                        WinHTTP.

                                        Quote
                                        Python/Perl already has extensive support for such things. COM? you might be surprised that Perl/Python supports COM as well.

                                        Did you even read my post?

                                        Quote from: BC_Programming
                                        and COM components are a lot easier to use from VBScript as compared to either Python or Perl (which in themselves need a module for this purpose)

                                        Quote
                                        How about portability of code? Python/Perl scripts works in Mac,*nix. Is vbscript portable?
                                        Nope. Sometimes I forget how important that 0.5 percent (ok, that's an underrepresentation) of the market considers itself though.
                                        I was trying to dereference Null Pointers before it was cool.

                                        ghostdog74



                                          Specialist

                                          Thanked: 27
                                          Re: Inserting a Blank Space Before Set /P Output
                                          « Reply #32 on: March 30, 2010, 09:15:07 AM »
                                          http://www.chilkatsoft.com/FTP-ActiveX.asp
                                          I was betting you are going to show me this.
                                          sad to say first version out of support and limited in functionality. 2nd version cost money. seriously ?

                                          Quote
                                          Google gives me 126,000 hits for "ActiveX Compression Library"
                                          out of the 126000 hits, which one is free and you have used it to support zip, gzip and is highly recommended to be used in vbscript ? with Perl/Python, compression libraries comes with the distribution and most of the time, its the recommended one to use and is supported by the community.

                                          Quote
                                          Again: a case of roll your own. Writing a sorting routine is easy. This hardly even counts.
                                          sorting stuff is so common in daily task, you don't  rewrite it when you want to use it every time . A good sorting library is a certainly a plus point. Try writing one by hand,  that sorts by a field, then another field, followed by another field, lastly, by another field but this time sort numerically. how much time would you need to do it with vbscript?

                                          A module for every thing i want to do is even better. honestly speaking, don't you sometimes want that?

                                          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: Inserting a Blank Space Before Set /P Output
                                          « Reply #33 on: March 30, 2010, 09:46:49 AM »
                                          Quote
                                          sorting stuff is so common in daily task, you don't  rewrite it when you want to use it every time

                                          No. you write it ONCE. and then you can <re-use> that every time.

                                          Quote
                                          A good sorting library is a certainly a plus point. Try writing one by hand,  that sorts by a field, then another field, followed by another field, lastly, by another field but this time sort numerically.

                                          Ever worked with listviews? Ever needed to do that as well as Natural sort the filename column? Yeah. done that. Actually, I didn't write the code  that does the sort algorithm, that is actually in comctl32.

                                          My Actual Sorting stuff can be used to sort objects, and since the Actual comparison routine can easily be overridden it's a simple matter to change the comparison to make it sort on different fields. This wouldn't extend directly to VBScript since none of the scripting languages supports early-binding to COM components that I know of nor implementing a COM interface. I think they support event sinking so I could just make it raise events or something.

                                          Either way, I never have to do anything with VBScript. I only have one Script file that I ever use, that re-links an executable to change the subsystem. That's it. I largely consider VBScript to be VB6 but to be frank VBScript blows in comparison. and I am reminded of that every time I use VBScript.

                                          WHY does it complain when I say Next <counter>? I could swear that's part of the language, but noooo, it makes me say just "next"...

                                          Quote
                                          I was betting you are going to show me this.
                                          sad to say first version out of support and limited in functionality. 2nd version cost money. seriously ?


                                          That was just from a quick google.

                                          There are FTP controls built into windows but I'm not sure if those can be used without a IOLEInPlaceSite implementor. (that is... a window) I know the "Script control" can be used just as an Object.


                                          Quote
                                          out of the 126000 hits, which one is free and you have used it to support zip, gzip and is highly recommended to be used in vbscript ? with Perl/Python, compression libraries comes with the distribution and most of the time, its the recommended one to use and is supported by the community.

                                          Personally I'd just Use BCFile for that. Of course I'd need to get BCFile to work in VBScript, a mystery I have yet to bother solving since I never use VBScript, or any other scripting language often enough.

                                          Actually, I think I've lost track of the very point of a scripting language, which is, in general, to provide these types of things. unzipping and zipping can be done with the built in windows Zipping/unzipping but the mechanism for doing so isn't immediately obvious. It can be used indirectly by simply copying a file out of a zipped file namespace, but again- not completely obvious.

                                          Anyway, I think this is what confused me:

                                          Quote
                                          but if i have a choice on language to use on a production project, it will not be vbscript

                                          a scripting language shouldn't be used in a "production" project. a scripting language should be used for scripting. python can be used for applications programming but that is- get this, outside the domain of VBScript (see the name? VBScript?) as far as Applications languages go python is an excellent choice but it's no better or no worse a choice then the other top contenders such as C#, VB.NET, F#, etc. Especially since the .NET framework is at least as extensive in function as perl/python modules; it includes classes for everything you mentioned previously and more.
                                          I was trying to dereference Null Pointers before it was cool.

                                          gpl



                                            Apprentice
                                          • Thanked: 27
                                            Re: Inserting a Blank Space Before Set /P Output
                                            « Reply #34 on: March 30, 2010, 12:42:43 PM »
                                            Language wars, I love them !!
                                            Seriously, if I wanted to ftp from vbscript I would (and have) call the ftp.exe on the command line

                                            Going back to the OP's question, are there 'invisible' characters that can be used as a space ? I remember the old DOS trick of naming a file <ALT>-255 to hide it no longer works under 32 bit windows

                                            Just a thought - does
                                            echo   Hallo
                                            give the required indentation ? If so and you can live with a non-indented response, follow the prompt with:
                                            Set /p var=
                                            Which will not add any prompt text

                                            Salmon Trout

                                            • Guest
                                            Re: Inserting a Blank Space Before Set /P Output
                                            « Reply #35 on: March 30, 2010, 02:17:21 PM »
                                            seems like W7 set /p strips leading spaces from the prompt string.

                                            Geek-9pm


                                              Mastermind
                                            • Geek After Dark
                                            • Thanked: 1026
                                              • Gekk9pm bnlog
                                            • Certifications: List
                                            • Computer: Specs
                                            • Experience: Expert
                                            • OS: Windows 10
                                            Re: Inserting a Blank Space Before Set /P Output
                                            « Reply #36 on: March 30, 2010, 05:39:32 PM »
                                            seems like W7 set /p strips leading spaces from the prompt string.
                                            Yes, and so does Vista. The command interpreter is "CMD.EXE" and it seems to be not the same one used in Windows XP that has the same name.

                                            So the challenge here is to either:
                                            1. Modify the way CMD does the SET command to allow e space char.
                                            OR
                                            2. A clean utility that will show a custom prompt to user and take input and store in  something that can be used later.

                                            Hmmm,  "assembly language for windows"  gives almost 2 million hits in Google. Maybe I should write a small machine code thing.


                                            ghostdog74



                                              Specialist

                                              Thanked: 27
                                              Re: Inserting a Blank Space Before Set /P Output
                                              « Reply #37 on: March 30, 2010, 06:16:01 PM »
                                              No. you write it ONCE. and then you can <re-use> that every time.
                                              that's right.! write it once and reuse. that's the beauty of modules/functions. I don't see a vbscript sorting function/library that is able to provide different sorting criteria, like the one i mention, or sorting by keys of a dictionary, or sorting an array according to the keys of another. or sorting by the Nth character position. If i want to do any of these sorting tasks, i just need to plug in my parameters and the sorting function will do the rest.

                                              Quote
                                              a scripting language shouldn't be used in a "production" project. a scripting language should be used for scripting. python can be used for applications programming but that is- get this, outside the domain of VBScript (see the name? VBScript?) as far as Applications languages go python is an excellent choice but it's no better or no worse a choice then the other top contenders such as C#, VB.NET, F#, etc. Especially since the .NET framework is at least as extensive in function as perl/python modules; it includes classes for everything you mentioned previously and more.
                                              that's not correct. PHP is a scripting language and there so many production web sites that use PHP. Similarly for Perl/Python. Why do you think sysadmins use them to do their admin task? Scripting languages can definitely by used anywhere. And Perl/Python are also considered scripting languages (general purpose). no different from vbscript. they both need interpreter to run their script.

                                              gregory

                                                Topic Starter


                                                Beginner

                                                Thanked: 1
                                                • Experience: Experienced
                                                • OS: Linux variant
                                                Re: Inserting a Blank Space Before Set /P Output
                                                « Reply #38 on: March 30, 2010, 06:21:20 PM »
                                                Just a thought - does
                                                echo   Hallo
                                                give the required indentation ? If so and you can live with a non-indented response, follow the prompt with:
                                                Set /p var=
                                                Which will not add any prompt text

                                                If I understand what you are saying correctly, the problem here is that set /p always(I think) uses its own line, even if you do something like:
                                                Code: [Select]
                                                echo  Faking the promptString here & set /p var=The user's input would start on a new line after the fake promptString, which is messy, and is still yet a displayed line that is not getting indented.

                                                I think I'll try the suggestion Salmon Trout gave, which was the third-party Editvar tool.

                                                I think I need to read the C book I bought 2 years ago and just be done with it. ;) ...then again maybe not

                                                Thanks to everyone again for all the help, this is a great community to be a part of, I wish I had more to give back.

                                                Geek-9pm


                                                  Mastermind
                                                • Geek After Dark
                                                • Thanked: 1026
                                                  • Gekk9pm bnlog
                                                • Certifications: List
                                                • Computer: Specs
                                                • Experience: Expert
                                                • OS: Windows 10
                                                Re: Inserting a Blank Space Before Set /P Output
                                                « Reply #39 on: March 31, 2010, 01:13:30 PM »
                                                Quote
                                                I think I'll try the suggestion Salmon Trout gave, which was the third-party Editvar tool.

                                                I think I need to read the C book I bought 2 years ago and just be done with it. Wink ...then again maybe not

                                                You have made a wise choice.
                                                Not the choice of everybody,
                                                Not the choice of the most clever.
                                                But the choice that will work for you.


                                                Salmon Trout

                                                • Guest
                                                Re: Inserting a Blank Space Before Set /P Output
                                                « Reply #40 on: March 31, 2010, 01:16:50 PM »
                                                Not the choice of the most clever.

                                                Are you saying I'm not clever?  :-[  :'( :'( :'( :'(


                                                Geek-9pm


                                                  Mastermind
                                                • Geek After Dark
                                                • Thanked: 1026
                                                  • Gekk9pm bnlog
                                                • Certifications: List
                                                • Computer: Specs
                                                • Experience: Expert
                                                • OS: Windows 10
                                                Re: Inserting a Blank Space Before Set /P Output
                                                « Reply #41 on: March 31, 2010, 01:28:51 PM »
                                                Are you saying I'm not clever?  :-[  :'( :'( :'( :'(
                                                Ah...er.. uh maybe I shod rephrase that.

                                                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: Inserting a Blank Space Before Set /P Output
                                                « Reply #42 on: March 31, 2010, 01:30:10 PM »
                                                Ah...er.. uh maybe I shod rephrase that.

                                                ah ha! so your saying his idea is shoddy!
                                                I was trying to dereference Null Pointers before it was cool.

                                                Salmon Trout

                                                • Guest
                                                Re: Inserting a Blank Space Before Set /P Output
                                                « Reply #43 on: March 31, 2010, 02:03:35 PM »
                                                ah ha! so your saying his idea is shoddy!

                                                I have been to "The shoddy capital of West Yorkshire", the town of Dewsbury. In the 19th century that region of England had a thriving cotton spinning industry and somebody invented a machine for grinding rags or pieces of waste or used cotton cloth, which was called "shoddy", so that the fibres ("fibers" in the US) could be spun into new cloth. The town became the hub of this industry and even in the 1980s the place was full of cotton recycling plants and in the streets you could see little bits of fluffy stuff lying on the ground. It made some people rich and gave jobs to a lot more.