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. Run the audio troubleshooter from a batch script

    in Windows 10 Drivers and Hardware
    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...
  3. Netfix Batch Script- Fix internet connection

    in Windows 10 Network and Sharing
    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...
  4. Batch script to automatically uninstall and Reinstall a driver

    in Windows 10 Drivers and Hardware
    Batch script to automatically uninstall and Reinstall a driver: For some strange reason I've had a faulty external Seagate 8TB driver/HDD for the last year The problem is this: everytime I reboot the computer, the HDD is not automatically recognized so I have to do this 1. Open Device Manager 2. Remove the USB attached SCSI mass storage...
  5. 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
  6. Running PowerShell script as a batch file

    in Windows 10 Network and Sharing
    Running PowerShell script as a batch file: Can I run the Power Shell line: "C:\Windows\System32>get-appxpackage *3dbuilder* | remove-appxpackage" from a .Bat file? ***Original title: Removing bloatware***...
  7. Batch Script to execute in Win 10 pro

    in Windows 10 Support
    Batch Script to execute in Win 10 pro: I'm looking for a batch script that can: Pull the single row taskbar to a 3 row taskbar and lock it in place in its default location (bottom). Change the time format at the bottom right corner from default to have e.g. "2:00 AM" in the first row, "Saturday" in the second...
  8. Batch File Problem

    in Windows 10 Support
    Batch File Problem: So I want to backup my saved game files after each time I play, as there is a bug after the latest patch that can delete your saves. Figured better to be safe then sorry. Now I found the following online and edited to my info... Code: @echo off cd "D:\Must Keep\Game & Other...
  9. Help needed writing batch script!

    in Windows 10 Support
    Help needed writing batch script!: Firstly thank you for even clicking on this thread as I understand that this probably isn't meant to be here. The scenario is that I'm trying to write a script that incorporates the result of a ping to an IP and then based on the result do different things. Here is an...
  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