Windows 10: Batch variables are not output?

Discus and support Batch variables are not output? in Windows 10 Network and Sharing to solve the problem; Hello everybody I have written the following script: @echo off setlocal enableDelayedExpansion :set/p again Z=Number of rows: set/p S=Number of... Discussion in 'Windows 10 Network and Sharing' started by Potterforever, Jun 23, 2020.

  1. Batch variables are not output?


    Hello everybody

    I have written the following script:

    Un this also works if Z is larger than S but if S is larger, then at the end Z times "ECHO is switched off (OFF)".

    does anyone have any idea what might be causing this?

    :)
     
    Potterforever, Jun 23, 2020
    #1
  2. Kari Win User

    How to output day of week to variable in batch


    DATE /T shows the date, not day of the week. You need WMIC command to get the day of the week:

    Code:
    Code:
    wmic path win32_localtime get dayofweek

    Batch variables are not output? [​IMG]


    The output will be a number from 1 to 7, 1 being either Sunday or Monday depending on what is your local setting, if the first day of the week is Sunday or Monday. In my case, European system and Monday as the first day of the week, the command shown in above screenshot (yellow highlight) gave just now the output (green highlight) as 5 (Friday).
     
  3. How to output day of week to variable in batch


    Hi all,

    I am trying to write a batch file in Windows 10 to output day of week (Monday, Tuesday etc) to variable do that I can do certain procedures on differnt days o the week and am having major problems.

    If I type DATE /T at command prompt I get 15/01/16 and no day of week.

    I have change regional setting so that long date is in correct format but still if I type DATE /T at command prompt I get 15/01/16 and no day of week.

    All help appreciated.

    Thank you.
     
    jaburmester, Jun 23, 2020
    #3
  4. Batch variables are not output?

    Batch: Unexpected Variable Results in Subroutine

    An answer to a previous question suggests this FOR line. Now I am trying to use the variable. My batch script at present:

    The output from this script is seven iterations of this:

    The subroutine seems to be doing something to the variable. Because when I substitute these lines:

    I get the desired result: six pairs of output of this nature:

    where the tilde removes the quotation marks, as expected.

    In the first code sample, the production of seven (not six) pairs of output lines suggests that the subroutine may be disregarding the quotation marks, rendering "3D" and "Objects" as two separate items -- which was an issue addressed in the previous question.

    I starting tinkering with the subroutine approach because I was having problems achieving a certain outcome using the simpler approach presented in the second code sample (above). Possibly delayed expansion would fix that, but at the cost of additional complexity. Not to deny that the subroutine's "goto :eof" line is also a little confusing, even if it does work.

    My specific question is, what's going wrong with the variable, when used in the subroutine? But if there is a better way, I would also appreciate at least a link in that direction.
     
    Ray Woodcock, Jun 23, 2020
    #4
Thema:

Batch variables are not output?

Loading...
  1. Batch variables are not output? - Similar Threads - Batch variables are

  2. Is PATH is on the User Variables, or System Variable?

    in Windows 10 Gaming
    Is PATH is on the User Variables, or System Variable?: Hello, I have a problem with my PATH variable in my Windows 8.1 computer.1. Where it all starts:I installed SQLite on my computer, and then i want to test it from Command Prompt with this command:sqlite3 test.dbBut the output is:'sqlite3' is not recognized as an internal or...
  3. Batch file not setting variables to DATE & TIME text valuse

    in Windows 10 Software and Apps
    Batch file not setting variables to DATE & TIME text valuse: Running the following batch script displays "downsecs = 1, DownStrtDate = and DownStrtTime =" Why are the variables DownStrtDate and DownStrtTime not properly set to the current date and time SET /A downsecs = 0 SET DownStrtDate = %DATE% SET DownStrtTime = %TIME% SET /A...
  4. Batch variable-text with distance to margin output?

    in Windows 10 Network and Sharing
    Batch variable-text with distance to margin output?: Hello Together i want to set a user-defined variable that will not display the text on the far left. if you set/p n= hello writes the text is still displayed on the far left Batch variablen-text mit Abstand zum rand ausgeben?
  5. regarding path variable of user variable of environment variable

    in Windows 10 Customization
    regarding path variable of user variable of environment variable: please help me fast, I accidentally deleted path variable of user variable ..... I want to restore it. the real situation is I cannot run android studio project and it shows error - " unable to start daemon process............This problem might be caused by incorrect...
  6. With batch file output as internet page?

    in Windows 10 Customization
    With batch file output as internet page?: Some years ago someone showed me how to create a website with a batch file. This was just text, it had no function. Does anyone know how to do this or does anyone know the orders? Mit Batch-Datei Ausgabe als Intenetseite?
  7. Using variables with the rename command in a batch file

    in Windows 10 Network and Sharing
    Using variables with the rename command in a batch file: Hello, I am trying to use variables in renaming a robocopy log file but I continually receive a 'syntax error'. Everything works perfectly until I use the rename command. I am using the latest build of Windows 10. Any advice will be appreciated, thank you. The batch...
  8. BATch output to file Heeeelp!

    in Windows 10 Support
    BATch output to file Heeeelp!: Win10 - 64 bit Pro. Version 1909. fully up to date, but obviously with KB4524244 uninstalled. *Sad G'day folks. I have a Win .BAT file that I run every day to copy important data from the days doings from the C:\ VRPC to the D:\VRPC. Below is one command line from the BAT...
  9. I need to run htpasswd from inside a batch script using a variables

    in Windows 10 Support
    I need to run htpasswd from inside a batch script using a variables: I have tried this every way i can think of. the batch is in the same folder as the .htaccess file to be modified. i can run the htpasswd file with -v and -b which should allow for batch and give me a clue of what went wrong if it does i set a pause right after the statement...
  10. How to output day of week to variable in batch

    in Windows 10 Support
    How to output day of week to variable in batch: Hi all, I am trying to write a batch file in Windows 10 to output day of week (Monday, Tuesday etc) to variable do that I can do certain procedures on differnt days o the week and am having major problems. If I type DATE /T at command prompt I get 15/01/16 and no day of...