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
0answers
12 views

How can I access Start Menu search functionality over RemoteApp?

I use RemoteApp on a daily basis for accessing remote applications using my local desktop window manager. This has worked very well for me, particularly while working from home during the current ...
1
vote
1answer
24 views

login to remote using “mstsc /admin” with password

I want to use mstsc /admin to login to a server silently. My batch file reads the code as set mysrvad=server_ip set mysrvid=id set mysrvpswd=pw cmdkey /generic:%mysrvad% /user:%mysrvid% /pass:%...
0
votes
2answers
23 views

Batch File; Run exe from Top folder of specified Directory

Question; Is there a way to direct this Batch file to the latest Version Folder (highest year) of AutoCAD 20xx found in the C:\Program Files\Autodesk\..? General Background; A number of staff run ...
0
votes
3answers
107 views

How to get a number out of a file name to use in cmd?

I have a bat file that automatically runs a server like this: cd %location_1%\target start java -jar cm-2.0.1.jar The name of the jar file will change for new releases: cm-2.0.2.jar cm-2.0.3.jar ...
0
votes
0answers
19 views

Bulk exif tags bat script not working peoperly

I have a batch script to set XMP:Subject Exif tags on pictures in bulk. tags.txt has all links of the pages and the tags. Links and Tags are separated by =. This script should divide the URL and Tags ...
0
votes
1answer
37 views

How do I make this code acknowledge spaces in a directory?

I want to make a file where it copies all images into a new folder in the current directory, except you can edit the file to get rid of directories like AppData or Program Files. Problem: it doesn't ...
1
vote
1answer
31 views

Copy first n hex of a file

You can output the first n hex bytes of a file in Linux with xdd (xdd -ps, etc) How would one do this on Windows, though? Is there a way?
1
vote
1answer
32 views

Get hard drive serial number based on drive letter on Windows Command Line (not Powershell) and store in variable

I know I can get the serial number of all listed hard drives by using: wmic diskdrive list brief or specifically wmic diskdrive get serialnumber And I can get the drive letter from the logical disk: ...
0
votes
1answer
20 views

How to insert text into a command inside a batch script

So I have a batch script and I would like the user to write something into the app. What I mean is, let's say the user has a batch script and the batch script would like to know the name of an app. ...
0
votes
0answers
24 views

Script for deleting files from recycle bin [closed]

Script for deleting files from recycle bin based on the original path of file/folder and that are N days older delete files based on following criteria a. files and/or folders that are older than N ...
-2
votes
2answers
83 views

How can I enter the following batch file code directly on the command line [closed]

I would like to enter the following batch file code directly on the command line: setlocal enabledelayedexpansion set "type=.jpg" set "source=c:\" set "dest=c:\AllPics" ...
0
votes
2answers
175 views

How do I make a running and working batch file from a pre-made batch file?

So I am trying to make a batch file from a pre-made batch file and I don't know how to got to the next line in the file without ruining it and it just saying what I want the command to do. This is ...
0
votes
0answers
26 views

Will 'mouse.bat moveBy 1x1' keep the screen from locking in an RDP session if it's run under a different user?

I'm using this Mouse.bat batch file to keep my screen from locking after 15 minutes (it's enforced by Group Policy). I have it set as a scheduled task to run every 10 minutes and it works with my ...
3
votes
2answers
106 views

Unable to call ffmpeg in a batch file

I reencode a lot of video files with ffmpeg using the following command at the prompt: for %F in ("..\*.*") DO ffmpeg -n -i "%F" -c:v libx265 -c:a copy "%~nF.mkv" I ...
0
votes
1answer
39 views

Extract Information from Clipboard and return partial Information back to Clipboard

I'm need a small batch-file which should help me extract an Information from the clipboard an return a partial information to the clipboard. I have come so far: @setlocal enableextensions ...
2
votes
1answer
23 views

Sending email with powershell

I am trying to send an email with powershell which I can call from my bat file. Below is the code which I have right now but I get the error below. Send-MailMessage -From "arnedeconinck3@gmail....
0
votes
3answers
64 views

Confused about goto label (batch file) Windows

If I use these commands this way around, it does what it should: If foo was previously set as one thing or another, it skips to foobar_menu If foo was previously not set as (the same) one thing or ...
2
votes
1answer
183 views

Can this batch file damage/prevent Windows 10 from booting?

Is there anything in the below .bat script that could delete/corrupt any Windows 10 system files and prevent them from starting, causing a boot loop? After rebooting, following the execution of the ....
0
votes
2answers
69 views

what can i add To Scan Folders Using This Comment?

I use this to delete some Files in my Flash USB echo "Enter Drive letter" set /p driveletter= attrib -s -h -a /s /d %driveletter%:\*.* del %driveletter%:\*.lnk del %driveletter%:\*.vbe ...
0
votes
1answer
41 views

How do I add IP ranges in batch file after setting a command to set a IP Address

I've tried to use the set/p command to set the static IP address using the command below. But how do I include the add command which allows me to add multiple IP ranges in the Advance tab? Meaning my ...
0
votes
1answer
48 views

How to Start an exe from .bat file without tying up the command line

I am using SSH to command line into another computer and execute .bat scripts. (Windows 10). But when I run a batch file that has the following in it start c:\Program Files\qBittorrent\qbittorrent....
1
vote
1answer
18 views

Overwrite folder with Xcopy

I have a backup folder that i should copy it weekly , so i use a batch file in the task sheduler of Windows contains this line xcopy /s "C:\backupMai" "\\myserver\backup$\logFile\...
0
votes
0answers
14 views

Run a NON-ELEVATED command from an already elevated batch file in Windows 10 [duplicate]

I have a batch file that runs at startup with admin privileges (using Task Scheduler) and does some maintenance tasks. However, there is a problem. I have a certain maintenance task I need to do which ...
0
votes
0answers
14 views

How to enter a FDE passhprase in a key authenticated SSH session in Windows, using one click?

I want my grandma to unlock an encrypted Linux server when I can't. She knows nothing about Linux, SSH, asymmetric keys, passphrases, etc., but she knows how use the mouse to click on an icon. The ...
1
vote
1answer
78 views

How to get tab-initiated lines using Findstr /B [TAB] in Bat/CMD

There is an option that works in Unix & Linux: Like @jimmij answer command: grep -B2 '^\t' file. But is there an option using only bat/cmd with the Findstr command? Already tried.. Findstr /bl [...
0
votes
2answers
21 views

Batch File: Search All Directories Except These Directories

I have a line of code that looks like this, which loads all immediate directory names into Variable A, then continues on through the rest of the loop. for /d %%A in (*) do How can I change this such ...
0
votes
0answers
27 views

Making a Batch File a Service stops Taskkill from working?

I have a batch file that checks to see if a program is running and will kill it when the requirements have been met. It works just fine when I run the .bat file via cmd, but when I make it a service (...
0
votes
0answers
32 views

How do I properly sync data between two Windows 10 systems on the same LAN utilizing Robocopy, a .bat file, and Task Scheduler?

I've read a number of posts regarding the use of robocopy to sync data between two Windows systems. I tried various configurations, and the settings I currently have in place are what seemed to work ...
0
votes
1answer
30 views

finding a list of words as files in a directory

I have a list of files that I'm looking for in a directory. They are all JPG files. I need to know how to return a value which will only look once in the directory. This will be within an existing ...
1
vote
1answer
28 views

Is there a command for setting unbuffered stdout and stderr in Windows batch?

I want to setup a command with unbuffered stdout and stderr. In Unix system, it can be achieved by using stdbuf -o0. For Python scripts, it can be achieved by using python -u. What is the equivalent ...
0
votes
1answer
30 views

Copy some information of logfile with specific date

I want to copy some information from a log file of PC in my company for a specific date, the remote PC has a Windows account with a password. I try to share the folder to have access to this one but I ...
0
votes
2answers
59 views

How can I find missing files in each sub directory?

For a Music collection (D:\Music), I'm looking for specific file names to see if they are there. They are: artist.jpg, front.jpg, back.jpg, CD.jpg, icon.jpg. For each Album folder, these files ...
0
votes
0answers
51 views

How do you edit a text outcome in a batch file

Im new to learning to code batch files. Basically I have this script @echo off echo. echo Current Serials- echo. wmic bios get serialnumber wmic diskdrive get serialnumber wmic baseboard get ...
0
votes
1answer
76 views

Why does cmd.exe stay open when I run a batch file opening many applications. How do I fix it (keep it closed)?

This is my batch: @echo off start "Start OneDrive" "C:\Users\username\AppData\Local\Microsoft\OneDrive\OneDrive.exe" start "Start Google Sync" "C:\Program Files\...
1
vote
1answer
28 views

How to automaticly restart a CLI program when it stops logging?

I have a CLI program that stops working from time to time. When it stops working, it would stop logging. Is there any way to restart it automatically when it stops logging? It won't become ...
-1
votes
1answer
65 views

How to get notification email every time an IP address of a website (dynamic DNS) gets changed?

My weekly task is to monitor the IP address from a list of my company's site with different port, the IP address is stored in txt file, for example: http://name1.domain.net:port http://name2.domain....
1
vote
1answer
73 views

Press ENTER in a program via .bat file

I want to start WhatsApp and send message with a .bat file. I will run this .bat file via another program. I haven't used a .bat file before so I don't know anything about it. I just wrote this : ...
1
vote
1answer
79 views

Command doesn't work from a .cmd file

This command works in a terminal, but if I save it in a .cmd, it doesn't show size in Mb : For %%_ in ("C:\ProgramData\Microsoft\Search\Data\Applications\Windows\Windows.edb") DO @(Set /a ...
1
vote
1answer
26 views

Changing A Windows 10 Account Name With A Batch File [duplicate]

I've been looking around and can't find an answer to this. i want to change an account name with a batch file
1
vote
1answer
131 views

How to Automatically Run a Batch File on a Self-Cleaning Virtual Machine?

I am trying to learn a little bit of test automation. I know some batch files, I am brushing up my "PowerShell" skills and - who knows - I might even end up using some bash, in the long run. ...
0
votes
0answers
20 views

TaskScheduler failure - should I be surprised?

Yesterday I spent several hours of my life which I'll never recover finding that, to my great surprise, W10 TaskScheduler is, apparently, crap. I had two repeating tasks, both intended to do backups ...
0
votes
0answers
30 views

Is there any way to have a new command start at every blank enter space for an entry?

I am nowhere near being competent in writing batch files so I figured someone here might have the answer. I am looking for a way to enter a list and have the list be google searched in a new tab/ ...
0
votes
2answers
78 views

Batch File - Is there a way to insert something like a page break to have different colored text?

I'm writing a batch file and wanted to know if there is a way to separate colors with different lines of text to highlight something. The batch file would have to be able to run on different PC's so ...
1
vote
1answer
46 views

Prevent “Exit” command in script to close Cmd

I have a .bat which emits "Exit 1" in case of failure, this is closing the cmd window and prevents user to see the details of error. I would like to force cmd to stay opened to see the ...
-1
votes
1answer
70 views

Substring after two character occurrences

I want to select a specific part of a string that could be like this: <text1>_<text2>_V1_0_<text3> I've tried something like this: set current_folder_path=%cd% set version=!...
0
votes
1answer
64 views

Freespace in CMD command

This command is amazing and just what I need. Thank you to who have written it. I made a bat file that shows all PC details on one screen.... So when I use this command in my bat file it keeps closing....
0
votes
2answers
18 views

Reboot Script / boot device

Is it possible to write a script to force a pc to reboot to the boot device selection mode? I did some research into this and always come up with ways to either boot a pc into the device selection ...
0
votes
0answers
15 views

Microsoft Edge Chromium: Some pages don't load unless focussed on when using a .bat file to load multiple sites

I use a .bat file to load multiple sites at once (see). When I do this, all sites open in separate tabs. However, I how to focus on each tab to have the page actually load. Some pages do load in the ...
0
votes
0answers
24 views

Batch file with UNC path

Note: While this question is related to LaTeX, it's not about LaTeX per se. That's why I ask here instead of on TeX.SX. I'm trying to modify my LaTeX compilation routine with Notepad++ and SumatraPDF ...
1
vote
1answer
91 views

Change a folder's icon with a custom right click menu

I try to make a custom right click menu that allows me to set a folder's custom icon using whatever folder.ico I put in that folder. My way so far: Have a right click menu on folders that runs a batch ...

1
2 3 4 5
54