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

Author Topic: how to add characters in this message ~Ex.) ("")  (Read 9438 times)

0 Members and 1 Guest are viewing this topic.

zask

    Topic Starter


    Intermediate

    • Experience: Experienced
    • OS: Other
    how to add characters in this message ~Ex.) ("")
    « on: January 11, 2016, 08:41:26 PM »
    i want to make a simple output like this

    echo |Del *.*

    except i want to add ("") around it

    for example it's output displays.

    C:\Users\Username\Desktop\*.*, Are you sure (Y/N)?

    what it does is answers the DEL "Are you sure" question automatically.

    i would like to change it's output message to

    C:\Users\Username\Desktop\*.*," Are you sure (Y/N)?"

    thanks

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: how to add characters in this message ~Ex.) ("")
    « Reply #1 on: January 11, 2016, 11:27:45 PM »
    So far it makes no sense.
    Do you understand the DEL options in Windows?
    Code: [Select]
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\User>help del
    Deletes one or more files.

    DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
    ERASE [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names

      names         Specifies a list of one or more files or directories.
                    Wildcards may be used to delete multiple files. If a
                    directory is specified, all files within the directory
                    will be deleted.

      /P            Prompts for confirmation before deleting each file.
      /F            Force deleting of read-only files.
      /S            Delete specified files from all subdirectories.
      /Q            Quiet mode, do not ask if ok to delete on global wildcard
      /A            Selects files to delete based on attributes
      attributes    R  Read-only files            S  System files
                    H  Hidden files               A  Files ready for archiving
                    -  Prefix meaning not

    If Command Extensions are enabled DEL and ERASE change as follows:

    The display semantics of the /S switch are reversed in that it shows
    you only the files that are deleted, not the ones it could not find.

    C:\Documents and Settings\User>
    The are are enough options to do nearly anything you want.
    So, what do you want?

    zask

      Topic Starter


      Intermediate

      • Experience: Experienced
      • OS: Other
      Re: how to add characters in this message ~Ex.) ("")
      « Reply #2 on: January 11, 2016, 11:41:05 PM »
      I just simply just want to add quotation marks around the output of the command

      echo |Del *.*

      the output displays this

      Are you sure (Y/N)?

      im trying to get it to do this

      "Are you sure (Y/N)?"

      thank you...

      foxidrive



        Specialist
      • Thanked: 268
      • Experience: Experienced
      • OS: Windows 8
      Re: how to add characters in this message ~Ex.) ("")
      « Reply #3 on: January 12, 2016, 03:44:08 AM »
      This is like your other thread zask - you're not describing what you actually want to do.

      If you want to add double quotes in that situation then describe why you want to do so.


      Without that information it seems too much like a pointless question which is designed to get information about a different task - and those questions often end up wasting the time of the volunteers...

      zask

        Topic Starter


        Intermediate

        • Experience: Experienced
        • OS: Other
        Re: how to add characters in this message ~Ex.) ("")
        « Reply #4 on: January 16, 2016, 04:34:48 PM »
        My bad
        « Last Edit: January 16, 2016, 04:56:24 PM by zask »

        zask

          Topic Starter


          Intermediate

          • Experience: Experienced
          • OS: Other
          Re: how to add characters in this message ~Ex.) ("")
          « Reply #5 on: January 16, 2016, 04:41:35 PM »
          This is what im trying to do. it just doesn't look right without quotation marks.

          I have a List of command that i am using that all have quotation marks around there outputs.

          @echo off
          echo This is "%%CD%%" which displays "%CD%" 
          echo and expands to the drive letter and path of the current directory.
          echo.
          echo This is "%%~DP0" which displays "%~DP0"
          echo and expands to the drive letter and path in which that batch file is located.
          echo.
          echo This is "%%~N0%%~X0" which displays "%~N0%~X0"
          echo and which is used to copy the current file to another directory.
          echo.
          echo This is "%%RANDOM%%" which displays this "%RANDOM%"
          echo and which is a variable that captures a somewhat random five digit number.
          echo.
          echo This is "%%ALLUSERSPROFILE%%" which displays this "%ALLUSERSPROFILE%"
          echo which also displays the Current Programs data folder.
          echo.
          echo This is "%%SYSTEMROOT%%" whish displays "%SYSTEMROOT%"
          echo which also displays the current location of the Windows foler.
          echo.
          echo This is "%%APPDATA%%" which displays "%APPDATA%"
          echo which displays the current location of the Appdata/roaming folder.
          echo.
          echo This is "%%CD%%" which displays "%CD%"
          echo which displays the current location of the Desktop
          echo.
          echo This is "%%PATH%%" which displays "%PATH%"
          echo which specifys a set of directories where executable programs are located
          echo.
          echo This is "%%TEMP%%" which displays "%TEMP%"
          echo which displays the current location of temp directory.
          echo.
          echo This is "%%DATE%%" which displays "%DATE%",
          echo which gives you the date.
          echo.
          echo This is "%%TIME%%" which displays "%TIME%",
          echo which gives you the time.
          echo.
          echo This is "echo |Del *.*" which displays
          echo |Del *.*

          But for the love that all is living I cant get quotation marks around the output of this last message.
          « Last Edit: January 16, 2016, 04:53:17 PM by zask »

          foxidrive



            Specialist
          • Thanked: 268
          • Experience: Experienced
          • OS: Windows 8
          Re: how to add characters in this message ~Ex.) ("")
          « Reply #6 on: January 18, 2016, 08:09:21 AM »
          I get this display with your code.  I'm still not clear what you are doing.

          Code: [Select]
          c:\>echo This is "echo |Del *.*" which displays
          This is "echo |Del *.*" which displays

          DaveLembke



            Sage
          • Thanked: 662
          • Certifications: List
          • Computer: Specs
          • Experience: Expert
          • OS: Windows 10
          Re: how to add characters in this message ~Ex.) ("")
          « Reply #7 on: January 18, 2016, 09:21:48 AM »
          Wondering if they are running into an issue with lack of escape character  :-\

          http://www.robvanderwoude.com/escapechars.php

          patio

          • Moderator


          • Genius
          • Maud' Dib
          • Thanked: 1769
            • Yes
          • Experience: Beginner
          • OS: Windows 7
          Re: how to add characters in this message ~Ex.) ("")
          « Reply #8 on: January 18, 2016, 09:47:50 AM »
          His wounds are generally self-inflicted...
          " Anyone who goes to a psychiatrist should have his head examined. "

          zask

            Topic Starter


            Intermediate

            • Experience: Experienced
            • OS: Other
            Re: how to add characters in this message ~Ex.) ("")
            « Reply #9 on: January 18, 2016, 05:58:00 PM »
            I get this display with your code.  I'm still not clear what you are doing.

            Code: [Select]
            c:\>echo This is "echo |Del *.*" which displays
            This is "echo |Del *.*" which displays

            i am creating a simple batch file that explains certain commands, every command i have has quotations added to it, but if i add quotations to the last command they will not display the output of the command, i want to be able to display the output of the command with quotes without the command not displaying it's output.

            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 to add characters in this message ~Ex.) ("")
            « Reply #10 on: January 18, 2016, 10:14:36 PM »
            If you want to display the output of a command, you have to run it.

            Don't run "Del *.*" arbitrarily, please.

            Besides- Del *.* outputs a prompt requiring Y or N.
            I was trying to dereference Null Pointers before it was cool.

            foxidrive



              Specialist
            • Thanked: 268
            • Experience: Experienced
            • OS: Windows 8
            Re: how to add characters in this message ~Ex.) ("")
            « Reply #11 on: January 19, 2016, 05:30:22 AM »
            i am creating a simple batch file that explains certain commands

            :)

            zask

              Topic Starter


              Intermediate

              • Experience: Experienced
              • OS: Other
              Re: how to add characters in this message ~Ex.) ("")
              « Reply #12 on: January 19, 2016, 09:51:44 PM »
              Patio you had no reason to close my last topic, all i had done was ask for a rating on my encrypted code and you started calling me a lier, telling me what i was using is pointless and saying that it is not encryption, you constantly say that your being patient but when i even give proof that my code if encrypted you locked it without even giving me a chance. It was not at all a malicious file. you didn't even try to use it in a bat file to see if it would even work you just constantly said that my information was incorrect. your mad because i proved you wrong. i used polymorphism which is a form of encryption that would commonly be used by viruses to avoid antivarus detection. but my file contained 0 viruses, worms, trojan or anything. it was just encrypted but you was to stubborn to take 5 seconds of your time copy and paste it into a batch flle and see if it would do anything. you just looked at it, clamed it a as bunch of garbage and starting telling me that it doesn't even work when ive ran and tested the program with 100% zero errors. please give me a logical reason of why you do that.
              If you will just try to see if it works then you would stop telling me that im wrong because im not, your just to suborn to get proved wrong

              Geek-9pm


                Mastermind
              • Geek After Dark
              • Thanked: 1026
                • Gekk9pm bnlog
              • Certifications: List
              • Computer: Specs
              • Experience: Expert
              • OS: Windows 10
              Re: how to add characters in this message ~Ex.) ("")
              « Reply #13 on: January 19, 2016, 10:10:59 PM »
              Zack, this forum is not a debate teram.

              If you are really deep into programming you would go to some place like stackoverflow. But I doubt they would tolerate your ranting.

              What was your question?  You need to add quotation marks to a string?
              Why is that so hard?
              If you have a list of strings , you can easily add a quote at the start and finish of each line. And there are other methods. The issue is trying to understand what your are thinking.  ???

              Again your issue is not explaining clearly and concisely what you need.

              zask

                Topic Starter


                Intermediate

                • Experience: Experienced
                • OS: Other
                Re: how to add characters in this message ~Ex.) ("")
                « Reply #14 on: January 19, 2016, 10:18:31 PM »
                i wasn't ranting he was constantly saying that my code wouldn't even work because it isn't even code, he was telling me that it wasn't encrypted and i even send him a link to proof that my type of code was a form of encryption. I told him it was a form of encryption called polymorphism. he blocked my page for no reason. i don't understand how he can say that something doesn't work, but wont even give 5 seconds of there time to test and see if it actually worked. I dont want no debate, im literally being called an idiot because he cant find the patience to even copy and paste a script of code. to back his source of telling me that my file doesn't work. it's his nonsense! he was the one who bringed al
                l the chaos