Windows 10: Batch File

Discus and support Batch File in Windows 10 Gaming to solve the problem; Hi, I am trying to create a batch file to determine whether a user account is signed on.I don't have enough experience to get it to @Echo it worked.... Discussion in 'Windows 10 Gaming' started by vRah, Oct 13, 2023.

  1. vRah Win User

    Batch File


    Hi, I am trying to create a batch file to determine whether a user account is signed on.I don't have enough experience to get it to @Echo it worked. Any advice please.Batch file:REM Query whether user SBackup is active@echo onsetlocal enabledelayedexpansionset varuser=Noneecho %varuser%if query user SBackup /server:Inspiron-5515 == "SBackup" set varuser=SBackup if "%varuser% == "SBackup" @Echo it workedecho %varuser%pauseCommand window results:

    :)
     
  2. oily_17 Win User

    Batch Files Knowledge Base

    Don't use batch files very much but one I find useful is for creating a list of files in a directory.
    Just copy the text below into Notepad and save as Filelist.bat

    dir /a /-p /o:gen >filelist.txt

    When you run it from a folder it will create a Filelist.txt file,in the same folder, that lists all the files in that folder.Useful when you are too lazy to type all the files out yourself.
     
    oily_17, Oct 13, 2023
    #2
  3. Batch Files Knowledge Base

    Very nice and usefull thanks for contributing.
     
    AphexDreamer, Oct 13, 2023
    #3
  4. Steevo Win User

    Batch File

    Batch file to ping network

    No, batch files are extremely easy.

    A "If" requires three extra steps.

    Code is not how much you can put in, but how lite can you make it and still perform the functions.

    So

    @ echo off


    ping 1.4.1.4 >a.txt

    findstr /m "Request timed out" a.txt
    if %errorlevel%%==0 (
    echo Save our nets!!!
    )

    pause
     
    Steevo, Oct 13, 2023
    #4
Thema:

Batch File

Loading...
  1. Batch File - Similar Threads - Batch File

  2. How do you pin a batch file created in Notepad to the Start Menu?

    in Windows 10 Gaming
    How do you pin a batch file created in Notepad to the Start Menu?: How do you pin a batch file created in Notepad to the Start Menu? I have the batch file...whatever.bat. What do I do now? I didn't understand other instructions I saw before. Thanks....
  3. How do you pin a batch file created in Notepad to the Start Menu?

    in Windows 10 Software and Apps
    How do you pin a batch file created in Notepad to the Start Menu?: How do you pin a batch file created in Notepad to the Start Menu? I have the batch file...whatever.bat. What do I do now? I didn't understand other instructions I saw before. Thanks....
  4. batch file for making normal window size bigger?

    in Windows 10 Gaming
    batch file for making normal window size bigger?: Is there a simple way, via a batch file, to stretch out the size of the normal window? I know i can maximize it, but then when moving between monitors, it goes back to a really small window....
  5. batch file for making normal window size bigger?

    in Windows 10 Software and Apps
    batch file for making normal window size bigger?: Is there a simple way, via a batch file, to stretch out the size of the normal window? I know i can maximize it, but then when moving between monitors, it goes back to a really small window....
  6. Batch Reset of Windows 11 File Explorer

    in Windows 10 Gaming
    Batch Reset of Windows 11 File Explorer: HiDoes someone know the batch code to reset all the settings of the Windows 11 File Explorer back to its default settings?Or eventually the registry folders/ keys that have to be removed to have it back to default?Thanks for your help....
  7. Batch Reset of Windows 11 File Explorer

    in Windows 10 Software and Apps
    Batch Reset of Windows 11 File Explorer: HiDoes someone know the batch code to reset all the settings of the Windows 11 File Explorer back to its default settings?Or eventually the registry folders/ keys that have to be removed to have it back to default?Thanks for your help....
  8. software publisher batch file

    in Windows 10 Gaming
    software publisher batch file: so im on windows 11 and mi trying to run a batch file to program on but its says to find a version for your pc please check software publisher https://answers.microsoft.com/en-us/windows/forum/all/software-publisher-batch-file/2e85470f-dc67-4afa-957f-4d3ed7128141
  9. software publisher batch file

    in Windows 10 Software and Apps
    software publisher batch file: so im on windows 11 and mi trying to run a batch file to program on but its says to find a version for your pc please check software publisher https://answers.microsoft.com/en-us/windows/forum/all/software-publisher-batch-file/2e85470f-dc67-4afa-957f-4d3ed7128141
  10. How do I revert the actions of this Batch file?

    in Windows 10 Software and Apps
    How do I revert the actions of this Batch file?: I was scouring the internet and came across a batch file that was supposed to restore the windows 8 UAC screen as I prefer it over the newer one. The batch file was meant to be ran using Windows 10 but it didn't specify that. Now when I try to open Registry Editor or run a...