batch-file

  1. N

    Creating .Bat with many commands

    My concern is "how to create .bat file which will launch a couple of commands and save completed result into a HTML file" I have next list of Windows (CMD) commands: Date, Time, Hostname, Net Accounts, Net Users, Net Group. For example: When i type: Echo Net Accounts >...
  2. S

    How to test if gcc has failed to compile a program in Windows Batch File (cmd)?

    I have made this random C code (app.c) int main() { ERROR; // Just a random code to make sure the compiler fails. } and this batch file (run.bat) @echo off :start cls echo Compiling... gcc app.c -o app.exe app.exe pause goto start When I double-click run.bat, it gives me the following...
  3. M

    How can delete all files with a specific extension with cmd batch, excluding 2 specific words? Windows

    I want to delete with a batch for windows all files with extension *.jpg in a folder (test) and its subfolder, except two files ex: abc.jpg and xyz.jpg that occur several times in different folders. I tried with h: cd test for /R %%f in (*.jpg) do (if not "%%~xf"=="abc.jpg" if not...
  4. P

    Visual Studio doesn't see all files in System32

    I set some post-build commands in Visual Studio 2017 that should allow me to run a program that I currently have in System32 (wsl.exe). However, Visual Studio doesn't see the program. I tried to set the command to dir C:\Windows\System32\ to see all the files it could list, and in fact it...
  5. O

    When nested within if statement, start cmd not executing properly in windows batch file

    For whatever reason, this command works: SET QUERY="heat wave" START /d "C:\Program Files (x86)\Google\Chrome\Application" chrome.exe https://www.google.com/search?q=%QUERY: =+% But this does not: SET SWITCH=1 IF %SWITCH%==1 ( SET QUERY="heat wave" START /d "C:\Program Files...
  6. D

    If exist does not work anymore in a batch file

    i have a problem with a batch. It scans folders for new pdf files, print, move and delete them. It worked fine until it suddenly stopped without an error. If i type it manually into the cmd it calls "file path does not exist", but it's the correct path. I don't have any clue, maybe some can help...
  7. H

    Batch file copying from multiple directories with same file names

    I would like to copy all .gml files from my downloads using a batch file, however, they are all in subdirectories and all called the same name. What I have so far is: FOR /r C:\Users\%USERNAME%\Downloads %%f in (*.gml) do copy %%~f C:\Users\%USERNAME%\Desktop\Inspire_Index_polygons\ This copies...
Top