Questions tagged [batch-file]

A batch file is a text file containing a series of commands that are executed by the command interpreter on MS-DOS, IBM OS/2, or Microsoft Windows systems.

Filter by
Sorted by
Tagged with
0
votes
1answer
21 views

change current keyboard layout via a .bat file [duplicate]

I got a windows 10 with 2 keyboard layout. I would like to switch progrmatically the current used keyboard via a bat file. Does anyone know what command does it? to make it clear, I do not want to ...
0
votes
1answer
24 views

Toggle Caps lock with command line batch file / RDP sync Caps lock

Whilst working from home using RDP and having email auto correct constantly putting my Caps lock out of sync, I've been looking at ways that I can re-sync and pre-set the CAPS lock status when opening ...
0
votes
1answer
16 views

XCOPY only files from a parent folder and from all its subforlders to a new folder?

I was searching a lot of times how to copy all the files of different extensions from a folder and all its subfolders to a new folder without copying the folders itself. I mean ONLY FILES. I have a ...
0
votes
1answer
55 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 ...
2
votes
3answers
110 views

Is it possible to set Windows console options for a single file?

I have a .bat file and want to disable QuickEdit-Mode for this single file: When I run the script and click on the window icon, I can go to the Properties, with the title showing: C:\Windows\system32\...
0
votes
2answers
62 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-...
0
votes
1answer
60 views

How to Run Batch File when the Active Window is Fullscreen (and on Exit Fullscreen)

As the title states, I want to write a script that detects when a program enters or exits fullscreen; these two triggers will then run one of two .bat files that start or stop the Rainmeter.exe ...
0
votes
1answer
49 views

Powershell GUI - not calling sub batch file

Regarding my Powershell script with GUI: When compiled as a .exe (PS2GUI with noConsole) it works properly, but when calling this same .exe from a .bat, it does not work: It does not start the Start-...
1
vote
0answers
52 views

Mirror a folder and extract all zip files in their respective subfolders using powershell

I need to maintain a mirror of a unix server folder on a Windows Server for which I am using WinSCP and the following code: option batch abort option confirm off open sftp://Americas\service-abbvie:...
0
votes
1answer
59 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 ...
1
vote
2answers
38 views

Where would I change the firewall setting in this setup?

Question: Is it possible to make a Windows Firewall application exception via command line or any other way? Why We have a host running Windows 2016 Server with several Hyper-V VM's also running ...
0
votes
1answer
40 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 ...
1
vote
0answers
41 views

Forcing Windows 10 to use a specific image for a user account via command line batch file

I have a batch file that I use when I am reinstalling Windows or setting up refurbished computers from customers. It does a couple of things, from creating an administrator account called Support with ...
1
vote
2answers
130 views

Windows: How to save a variable -(input: path) to text file

I'm trying to save a variable to text file, but i'm failing: :folder echo. && echo Where is your folder ? set /p userinputpath = Type input[Drive][Path]: echo "%userinputpath%" >> ...
0
votes
0answers
31 views

Need cmd/bat scripting help to check free space and do one thing if large enough Or a different thing if not

I have a home lab with a server and associated domain. on a previous iteration I tried roaming profiles but that was fail for so many reasons. I am in the process of integrating a new deployment ...
1
vote
1answer
45 views

Batch file to create folder based on filename

I need to create a bat file that will create a folder based on part of the filename. Below should create 2 folders using the date within the file. It is 3 Adobe files and 1 .txt file: File name ...
1
vote
1answer
52 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\...
0
votes
1answer
32 views

Double extension file

i don't know from where I got this file in my computer's temp folder C:\USERS\xxxxxxxxxx\APPDATA\LOCAL\TEMP\TMPE8FE.TMP.BAT is it some kind of malware? if yes, then how should i resolve this.
2
votes
3answers
148 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 ...
1
vote
1answer
168 views

How to have my computer go to sleep after a scheduled task ONLY if the computer was woken up by the task in the first place

Using Windows Task Scheduler I have a task I want to run at 5:30 PM Daily, but I'm not sure if I'll be on that computer at the time of the task. So, I want to allow Windows to wake my computer to ...
1
vote
2answers
50 views

Why can't I run a batch file to copy files?

I'm just trying to run a simple batch script to copy a file: xcopy /s c:\source\document.txt c:\destination Nothing is copied, and I get the response: 0 File(s) copied I've done this before and ...
1
vote
1answer
32 views

How to use robocopy with exclusions

I am using robocopy to copy folders and files from source to destination. origin_path: folder1 folder2 folder3 file1.txt file2.log file3.png dest_path: folder_important folder1 folder2 this is ...
0
votes
0answers
41 views

how to find certificates using keyusage values

Experts, anyone know how to find certificates using keyusage values? I'm searching for my personal store certificates containing with specific keyusage values. any help? i wasn't able to find any ...
1
vote
1answer
133 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 ...
1
vote
3answers
58 views

How to pin a specific batch file to start menu or task bar

I have a batch file that I want to run easily on Windows 10. I am trying to pin it either to the start menu, or the task bar, or at least have it come up when I search from the start menu. I have ...
-2
votes
1answer
29 views

Set Exit Path Dependent on Whether User Clicks Yes or No

I have a batch file that requests UAC privileges. When the UAC box pops up and a user clicks the no button I want to display message No administration privileges granted. Now exiting. and then wait ...
1
vote
2answers
160 views

Startup .bat throws “cannot find the path specified” error

I've seen there are a plethora of different posts and solutions regarding this specific issue, yet for some reason after implementing nearly all the results I've come across I'm still maddeningly ...
0
votes
0answers
33 views

copy all files, meta data, and sub directories [duplicate]

I would like to transfer all files, from one external drive to another external. I would like to: Maintain all file metadata including, but not limited to security, modified date, owner, creater, ...
0
votes
3answers
96 views

Trying to create a Bat file to copy single file into a folder that contains multiple folders within folders

I have a file called .nomedia. I am trying to copy it into a folder called Media, and inside Media there are 1000's of folders within folders within folders within folders. I need to paste the ....
-2
votes
0answers
29 views

Multiple Start and Wait in Batch File

i have a main.bat where i want to start multiple bat inside simultaneously. start test2.bat timeout 2 start test2.bat timeout 2 start test2.bat after all this bat is finished i want to run another ...
0
votes
1answer
81 views

How to get Windows 10 to execute a shutdown script prior to the “closing X apps and restarting screen”?

The problem I have is that I have an application (steamVR) that refuses to shut down when it receives a shutdown signal. It instead brings up a popup "critical error" message and a second "are you ...
0
votes
2answers
45 views

Can I create a shortcut to “troubleshoot network connection”?

I have a VM which very often needs the network adapter resetting (off topic here). I do this: It takes a few clicks to initiate it then click through the resulting dialog. Is there a way I could ...
0
votes
2answers
38 views

need help using curl for variables twice with batch

@echo off for /F %%I in ('curl https://ipinfo.io/ip') do set IP1=%%I for /F %%A in ('curl http://api.ipstack.com/%IP1%?access_key=mykey&format=1') do set IP=%%A echo %IP% pause I can't figure ...
2
votes
2answers
64 views

How to get the dir name where I ran the command

I have a folder like this C:\repos\3333-new-feature. And from that location, in a git bash terminal, I run a bat file: /c/repo/3333-new-feature $ myBat.bat One of the instructions in the bat should ...
0
votes
0answers
30 views

Can we execute a BATCH(.bat) file from a .dll? I am not able to do so

I have an application where you can create custom dll's for the purpose of alerting and monitoring. I need to run a batch file through that custom dll so that previously running environments could ...
2
votes
1answer
86 views

Pipe output from DIR into CERTUTIL

In Win10, looking for way to pipe the output from a DIR command at the Command Prompt or in a Batch File to serve as input to the CERTUTIL command. IOW, I want to get the MD5 hash for all of the files ...
1
vote
2answers
68 views

Running file from batch file

I am working in Windows 10. This is my code saved in .bat file: %windir%\System32\cmd.exe "/K" C:\Users\Alex\AppData\Local\Continuum\anaconda3\Scripts\activate.bat C:\Users\Alex\AppData\Local\...
0
votes
2answers
54 views

Creating shortcut and renaming on desktop using batch file

Good Morning, I have the following piece of code below that I've tweaked to map a few network drives. I'd like it to be tweaked (but I'm not sure how) so that it maps the network drives, creates a ...
0
votes
1answer
64 views

.bat file - TXT Log downloaded files, if its repeated, then delete

New code still not working :( please help me fix this @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION SET "SEARCH_DIR=%~dp0FILES" FOR /F "tokens=*" "%%a" IN (log.txt) DO ( FOR /R "%SEARCH_DIR%" %%f ...
0
votes
0answers
42 views

Windows change language changing shortcut via bat or powershell file

I am in need of a bat or powershell command to change the language switching shortcut in Windows (for example from Caps Lock to Left Shift + Left Alt. Is it possible to do something like this?
3
votes
2answers
653 views

ASCII code in batch file, doesn't seem to print right no matter what i try

echo██▓███ ▄▄▄ ██▀███ ▄▄▄ ▓█████▄ ▒█████ ▒██ ██▒ echo▓██░ ██▒▒████▄ ▓██ ▒ ██▒▒████▄ ▒██▀ ██▌▒██▒ ██▒▒▒ █ █ ▒░ echo▓██░ ██▓▒▒██ ▀█▄ ▓██ ░▄█ ▒▒██ ▀█▄ ░██ █▌▒██░ ██▒░░ ...
0
votes
1answer
40 views

Can we .bat script 'unpinning' several items from windows taskbar? How about repin?

Can we .bat script 'unpinning' several items from windows taskbar? How about repinning items to the windows taskbar?
0
votes
0answers
48 views

Force Windows 10 to install automatic WSUS update

A Windows 10 PC is connected to a WSUS intranet server, like a lot of other PCs here which are functioning fine, but others do not receive WSUS updates. I've written .bat file to force remote pc to ...
-1
votes
1answer
55 views

Searching for file in .bat

I want to delete all pdf files from a folder, that doesn't contain words "Times" OR "Wall" in their file names. So files 1.pdf 2.pdf All_Times_to_ride.pdf Wall.pdf are in and All_Times_to_ride.pdf ...
-1
votes
1answer
17 views

PDF Files Compression Ghostscript

Can someone check the code and find what is wrong ? I fight with it some time and don't have a clue whats wrong... I get error: '-sDEVICE' is not recognized as an internal or external command, ...
1
vote
2answers
66 views

How To Deal With “.” in the middle of a program name In a bat File?

I need to check with a bat file if a program is running in tasksheduler. The big problem is this program is from external guys and have four "." in the middle of the name. I'm using this code : ...
0
votes
1answer
34 views

Unable to terminate a batch file while running from powershell

I have created a batch file which runs an exe file remotely, i'm sending that batch file to destination location and run the batch through powershell. batchfile.bat f: cd \test\exe testsql.exe >&...
0
votes
0answers
20 views

Converting Black and White Images to Grayscale

I'm doing a little image project with imagemagick, but I'm fairly new to everything and pretty mediocre at programming. What I'm trying to do is convert all images that are close to black and white (...
2
votes
1answer
123 views

Windows Command Line / Batch File Check if 7zip password is correct?

In a Windows batch file is there a way to check if 7zip password for a zipped file is correct? I'd like to check if it succeeds, continue with the script (with call or goto routine), and if it does ...
0
votes
1answer
56 views

Extract every frame of multiple videos to image with ffmpeg .bat files

So I have a bunch of short videos I want to convert into images. In the past, I've used ffmpeg and .bat files to convert multiple videos from one file type to another, using two .bat files containing: ...

1
2 3 4 5
50