Skip to main content

All Questions

Tagged with
3 votes
3 answers
8k views

How to delete all files in subfolders but not subfolders themselves via command line on Windows?

For a given folder, I need to delete all files (various extensions) in all subfolders but not the subfolders themselves because I need to preserve the folder structure. Is there a way to do that via ...
Nyan Octo Cat's user avatar
0 votes
1 answer
431 views

For Loops in Windows Batch files

I have some for loop code in a Windows Batch file for youtube-dl which looks like the following: for %%a in (%*) do ( .\youtube-dl.exe ^ %%a ^ --playlist-start 1 timeout /t 300 ) I then put this code ...
user3992's user avatar
  • 231
3 votes
3 answers
7k views

In Batch Script, Extract String from a XML

I'm new to batch scripting. I'm trying to extract the status from a XML output. Basically I need appPoolState from below, if it's "Started". <output> <MSDeploy.recycleApp> ...
dp119's user avatar
  • 33
-3 votes
2 answers
66 views

Delete files with different extensions

i have the following problem: the software with which I read out my defective hard drive gave me all files with duplicates sometimes up to 15 times. One file with its duplicates looks and are named ...
Yakup's user avatar
  • 1
0 votes
0 answers
92 views

Batch file - how to create a folder with a promt, and then copy a file into that folder

I have a specific issue I'd like help with. I want to write a batch file that first prompts a user to name a folder, to be created in a designated location. I then want to copy a file from a ...
Jose Gonzales's user avatar
7 votes
0 answers
5k views

Robocopy loops/nests "Application Data" 29 times when copying "Application Data" folder on Windows 10

My goal here is to be able to back up my entire computer by using robocopy. My robocopy script keeps getting stuck here as you can see with the Application Data. C:\Documents and Settings\All Users\...
CreativiTimothy's user avatar
0 votes
1 answer
1k views

How to make ORelio Minecraft Console Client move player every 5 minutes

I'm using ORelio's Minecraft Console Client to bring my alternate accounts onto a server. I have written a windows batch file that can open the client, log into my account, and then connect to a ...
Craze's user avatar
  • 1
1 vote
1 answer
727 views

How to run a .batch file as if it were a .bat file

Context: I have associated .batch extension to be opened by my text editor by default when double-clicking or hitting ENTER on it in the Explorer (default action for "Open"). (I probably can't do ...
Basj's user avatar
  • 1,916
0 votes
2 answers
92 views

I am looking for a way to delete files in a specific order: delete 2, skip 3, delete 2, skip 3, etc

I am working with an interlaced video file that I have created an image sequence from. My goal is to delete the interlaced frames, which in my folder, is 2 interlaced images, followed by 3 non-...
Eric's user avatar
  • 1
0 votes
1 answer
534 views

How can I remove the Windows 10 Home pin sign-in with a batch script?

I have powercfg /SETACVALUEINDEX SCHEME_CURRENT SUB_NONE CONSOLELOCK 0 powercfg /SETDCVALUEINDEX SCHEME_CURRENT SUB_NONE CONSOLELOCK 0 in my batch script but if I restart the machine or put the ...
Kat's user avatar
  • 135
1 vote
1 answer
1k views

Escaping Parenthesis within a file path Parameter in a batch script

I've created a batch script to do some basic file management for me. It's passed in either a directory or file path, along with a category. The program will then Copy the file to another directory of ...
freebird's user avatar
  • 162
1 vote
1 answer
481 views

Prevent deleted files from running in the Startup folder

I have a batch script in my startup folder called everytime.bat that deletes all files except for the batch script. @echo off REM delete everything in startup except this file cd "C:\ProgramData\...
Kat's user avatar
  • 135
3 votes
3 answers
218 views

Delete files depending on positions/file name in the current folder / define multiple values effectively

How do I effectively delete several files depending on their positions(edit: or retrieve the files by their number) in the current folder? Preferably I need a solution with a normal .bat file. The ...
atereou's user avatar
  • 359
1 vote
1 answer
1k views

How to recursive copy files from a list of files in a text file using a Windows batch file?

Parent folder: Root Subfolder1: Has 12000 files i.e. subfolder1\885.txt Subfolder2: Has 15000 files i.e. subfolder2\882.txt Source file list names.ext contains 500 different names: 882.txt 550.txt ...
Asad Ali Hussaini's user avatar
2 votes
1 answer
4k views

Pass variable to filename in Windows FOR / DO Batch File

I have the following code where I systematically go through and compress each file individually. I don't care what the file name is, but I want it hidden more or less so will just call each file "file ...
HTWingNut's user avatar
  • 509

15 30 50 per page
1
5 6
7
8 9
25