Windows 10: Batch scripting problems

Discus and support Batch scripting problems in Windows 10 Ask Insider to solve the problem; So i found a bug. In batch scripting, I can only store 3 variables. I don't know the cause for this. Here's the code, if you need it. @ echo off... Discussion in 'Windows 10 Ask Insider' started by /u/Lackmey, Dec 24, 2019.

  1. Batch scripting problems


    So i found a bug. In batch scripting, I can only store 3 variables. I don't know the cause for this. Here's the code, if you need it.



    @ echo off

    title Elevator OS by Lackmey on YouTube and Reddit

    set gdata=No data found (this one works)

    set 1data=No data found (this one says data)

    set 2data=No data found (this one too)

    set 3data=No data found (you get the gist)

    set 4data=No data found

    set 5data=No data found

    set 6data=No data found

    set 7data=No data found

    set 8data=No data found

    set 9data=No data found

    goto top

    :read

    if %floor%==G echo %gdata%

    if %floor%==1 echo %1data%

    if %floor%==2 echo %2data%

    if %floor%==3 echo %3data%

    if %floor%==4 echo %4data%

    if %floor%==5 echo %5data%

    if %floor%==6 echo %6data%

    if %floor%==7 echo %7data%

    if %floor%==8 echo %8data%

    if %floor%==9 echo %9data%

    pause

    goto os

    :setfloor

    set /p floor=

    goto os

    :invalfloor

    cls & echo There is no floor number %floor%! & set floor=G& pause & cls & goto os

    :write

    if %floor%==G set /p gdata=

    if %floor%==1 set /p 1data=

    if %floor%==2 set /p 2data=

    if %floor%==3 set /p 3data=

    if %floor%==4 set /p 4data=

    if %floor%==5 set /p 5data=

    if %floor%==6 set /p 6data=

    if %floor%==7 set /p 7data=

    if %floor%==8 set /p 8data=

    if %floor%==9 set /p 9data=

    goto os

    :top

    echo Hello! Ever since you turned off your computer, The security guards at C:\ Inc. have escorted your data from the

    echo building.

    pause

    cls

    set floor=G

    Batch scripting problems :eek:s

    if %floor% neq G if %floor% neq 1 if %floor% neq 2 if %floor% neq 3 if %floor% neq 4 if %floor% neq 5 if %floor% neq 6 if %floor% neq 7 if %floor% neq 8 if %floor% neq 9 goto invalfloor

    cls

    echo The time is %time%

    echo The date is %date%

    echo Only floors G-9 are supported. (G,1,2,3,5,6,7,8,9)

    echo ..............

    echo . I floor %floor% I. (the floor variable works)

    echo . .

    echo . .

    echo .. @ .

    echo . /[]\ .

    echo . /\ .

    echo ..............

    :choices

    echo Change floor, Read data, or Write data? (C/R/W)

    set /p choice= (this variable works)

    if %choice%==R goto read

    if %choice%==W goto write

    if %choice%==C goto setfloor

    submitted by /u/Lackmey
    [link] [comments]

    :)
     
    /u/Lackmey, Dec 24, 2019
    #1
  2. yegorsw Win User

    Run the audio troubleshooter from a batch script

    I have an automated home theatre setup - a batch script that enables my TV as a display, and changes the TV to be my primary display (so games and apps open on my TV instead of my monitor).

    The same script also changes my default audio device to be the TV.

    The problem is every time I turn off my TV, it disappears from the list of audio output devices in Windows 10, and even when I turn it back on, it does not appear in the list. However, if I RIGHT CLICK on the audio icon and select "troubleshoot sound problems"
    and immediately cancel/close the troubleshooter, the TV is automagically added to my list of output devices.

    My question is - is there any way to have this troubleshooter be launched from a batch script and instantly closed? Alternatively, is there a way to force a refresh of the audio devices through a batch script?
     
    yegorsw, Dec 24, 2019
    #2
  3. Julivgar Win User
    Netfix Batch Script- Fix internet connection

    Somebody please try my batch script Netfix and leave feedback so I can improve it. thank you!

    My goal is to make a troubleshooter to help the built in "Windows Network Diagnostics" fix internet connection problems. How can you help?

    1. Download/copy the code on notepad then save as "Netfix.bat" or "Netfix.cmd"

    2. Test the Batch script

    3. Provide feedback and/or suggestions

    Thank you!
     
    Julivgar, Dec 24, 2019
    #3
  4. Batch scripting problems

    Task scheduler simply refuses to run a batch script

    Thank you for helping me to find the problem Batch scripting problems :)

    Apparently the problem was not that the batch script did not run in task scheduler—in fact, it was the particular command in the batch script. When I ran the task with the updated batch commands that you provided me above, I did not see the background change
    Batch scripting problems :(, but the log file said that the task started and ended. Yet when I manually ran the script, it changed the background as intended.

    And I am stuck again. But at least... PROGRESS Batch scripting problems :)
     
    Tinker Alpha, Dec 24, 2019
    #4
Thema:

Batch scripting problems

Loading...
  1. Batch scripting problems - Similar Threads - Batch scripting problems

  2. Batch scripting

    in Windows 10 Software and Apps
    Batch scripting: Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:Code and result:Code:@echo off echo You are going to use DISM. echo 1. To check the image. echo 2. Scan your PC's health echo 3. Restore your PC'S health. echo To continue, press...
  3. Batch scripting

    in Windows 10 Gaming
    Batch scripting: Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:Code and result:Code:@echo off echo You are going to use DISM. echo 1. To check the image. echo 2. Scan your PC's health echo 3. Restore your PC'S health. echo To continue, press...
  4. Batch scripting

    in Windows 10 Network and Sharing
    Batch scripting: Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:@echo off echo You are going to use DISM. echo 1. To check the image. echo 2. Scan your PC's health echo 3. Restore your PC'S health. echo To continue, press any key. echo Before...
  5. PageFile.sys batch script

    in Windows 10 Virtualization
    PageFile.sys batch script: Hello, I need help writing a batch script that would configure Windows Virtual Memory based on the amount of RAM installed If you have 4 GB of RAM, set virtual memory to 8 GB (Custom size: set both initial and maximum size to 8192) If you have 8 GB of RAM, set virtual memory...
  6. How to undo a batch script

    in Windows 10 Network and Sharing
    How to undo a batch script: I decided it would be a good idea to download and run a random batch script from the internet to get the ability to move files around freely, rather than sticking to the presets. Microsoft, if you see this, please allow us to move and organize files as we wish and not have to...
  7. Batch Rename Script Help!

    in Windows 10 Support
    Batch Rename Script Help!: Hello! I am very new to this and need a little help. I am trying to create a batch file that will rename files that are called png_X.png (the X being the number page it is). The code I have is below. It works fine with out the pipe sort command but it sorts the by the ones...
  8. Batch Scripts / Programs.

    in Windows 10 Performance & Maintenance
    Batch Scripts / Programs.: The members and quests who use this forum know how professional, informative and helpful it is! In order to help members solve their problems/issues we often ask them to run certain programs and perform certain tasks and then upload [ post ] the results to the forum for us...
  9. Automatically Run Batch Script

    in Windows 10 Installation and Upgrade
    Automatically Run Batch Script: Hi everyone When the windows installation is finished, automatically run batch script. How can I do that? Thanks *Wink 122531
  10. Batch script question

    in Windows 10 Support
    Batch script question: Hello, I want make a batch script to delete a spefic folder on the C disk, but how can I get only that spefic folder? I got this: Code: FOR /D %%p IN ("C:\USERS\%USERNAME%\Downloads\*.*") DO rmdir "%%p" /s /q cd C:\USERS\%USERNAME%\Downloads\ del *.* /q /s timeout /t 5...

Users found this page by searching for:

  1. windows batch troublshoot