Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

-1
votes
0answers
15 views

Rename a subfolder and apply attributes to it in batch? [on hold]

Alright, so all i'm trying to do is rename a subfolder in a folder with a .bat file. The line looks something like \tests\Area51\Sector1 and the .bat file has to be in the tests folder. I've ...
0
votes
0answers
19 views

CMD Fileless equivalent of < redirection

I have a batch that wraps AnyConnect Mobility Client CLI (vpncli.exe) and asks username and password to later handle them to vpncli. Simplified code: set /p user_id=Username: set /p pwd=Password: ...
-1
votes
0answers
22 views

Custom PING.EXE or Batch [duplicate]

I would like to make my own custom ping command using batch for windows, I can upload my script if you would like to see, but my main question is how can I alter what the result of the ping is. For ...
1
vote
0answers
25 views

Windows batch file to import LAN or Wireless profile regardless interface name

How do I ignore interface name when importing network profile? Below batch files only work if the endpoint have the same interface name (Windows interface names usually are: Local Area Connection, ...
-3
votes
2answers
34 views

Batch File Deleting [on hold]

How to delete specific files on every folders and subfolders using batch? is there any way to delete files on the network folders? it contains a lot of folders and files on each folders so it would be ...
0
votes
1answer
25 views

Batch move subsubfolders & files by up a level

I have a directory that looks like this Root Folder - Folder A - Subfolder - File1 - File2 - File3 - Folder B - Subfolder - File1 - File2 - ...
-1
votes
0answers
18 views

Associate many filetype [closed]

I have script for change file type extensions and changed all filetypes but TXT without only. @echo off rem --> Check for permissions >nul 1>nul 2>nul "%SYSTEMROOT%\system32\cacls.exe" "%...
0
votes
0answers
46 views

Batch File will run from command line, but not Task Scheduler

enter image description hereI have several computers, all running Windows 10 Pro x64. All were upgraded from Windows 7/8 via the Microsoft free upgrade offer of more than 1 year ago. One of these ...
1
vote
2answers
63 views

Can delete a file through windows explorer but not through batch file

When trying to delete a file from a network location via windows (I am on windows 7) batch file using a "del" command with /f and /q flags, I see an "Access is denied." message, and the file is not ...
0
votes
2answers
80 views

How to I export filenames, filepath and properties of a directory tree to CSV?

I have a hard drive full of backups that I need to detail on a spreadsheet quickly and in the following specific way. I'm hoping there's an easy way to do what i need via some sort of .bat or .cmd ...
0
votes
1answer
49 views

Why does the ping command in my batch file execute in a loop and navigates to the beginning?

I created a .BAT file in Windows 10 that has the following lines: set /p ipadress="Please select your favourite IP-adress." echo %ipadress% ping %ipadress% -n 10 However, when I navigate on this ...
0
votes
0answers
33 views

Windows 10: bat files not being run when double clicked

somethings has been changed in my win10 pro (Microsoft Windows [Version 10.0.17763.134]) box, and now I have issues with bat files: when I double click on them, I get a cmd, empty that shows up for a ...
0
votes
2answers
83 views

Windows cannot find .bat. Make sure you typed the name correctly, and then try again

I have no idea when this started to happen but it is preventing me from opening .bat files on double click. I am only able to run it as administrator. Is there anyway to fix this so i can double click ...
2
votes
1answer
62 views

Removing 3D Builder in Windows 10

I type this in PowerShell running as administrator to remove 3D Builder: C:\Windows\System32>get-appxpackage *3dbuilder* | remove-appxpackage It works fine, but how can I write the line in a ...
0
votes
2answers
46 views

batch file to copy files to specified folders

I have a batch file that receives 1 to 9 files (or more) and it needs to copy those files to a set of folders. Can anyone help me out? I'm trying to do something like this: for /L %%i in (1,1,9) do (...
0
votes
0answers
47 views

How to make Output filename template for youtube-dl using batch file window?

I ran command in command prompt which work like charm. youtube-dl -o "D:\yt\%~1\%(playlist)s\%(playlist_index)s - %(title)s.%(ext)s" --batch-file=ylink.txt Now, I want this command to execute from ...
2
votes
1answer
26 views

How do I configure a batch file to be run as a Scheduled Task? [closed]

I have a batch file called index.bat, which runs the following command: node index.js I tried to configure the file to be run on start up using schedule task manager and but it did not work as ...
2
votes
0answers
15 views

If any string exists in the computer name, the condition should be set to true [closed]

I am trying to check if a Computer name has BKUP, NAS, PLAYER, or BACKUP in any part of its name through a batch script. If the condition is true I will run an additional command to create a network ...
-2
votes
0answers
64 views

Renaming Administrator and Guest accounts in a Batch file

If possible, how do you rename the Administrator and Guest accounts in a Batch file? I am trying to write a script that will fix many vulnerabilities for cyberpatriot. So far I have @echo off :: ...
0
votes
1answer
79 views

Maven command into bat

I must run a maven project from command line with this command and works fine: mvn -Dexec.args="-classpath %classpath com.mycompany.serverrds.serverMainClass" -Dexec.executable="C:\Program Files\Java\...
2
votes
2answers
29 views

Compare files including final newline

I've made three text files: 0nl.txt, 1nl.txt and 2nl.txt. They both have the same content: test hello The only difference between them is how many newlines they have after the final 'o', with 0, 1 ...
0
votes
2answers
40 views

WMIC batch file to loop through CSV and get drive status

I am using this code to check the drive health status of remote PC's in my company for /f "tokens=1 delims= " %%a in (C:\temp\HOSTNAMES.csv) do ( WMIC /Node:%%a DiskDrive GET Caption, Status ) ...
0
votes
0answers
63 views

Execute two differents files with a batch file

My Effort I've been at this for about 3 hours of playing with the virtual desktop combinations with Rainmeter and I'm a total newbie at scripting logic. I'm having trouble figuring out how to make it ...
0
votes
1answer
16 views

Would a reg command run from a batch file require admin perms?

Would something like: reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Run\ /v %keyname% /t REG_SZ /d "%expath%" require administrator privileges to be able to execute from a batch file?
1
vote
1answer
44 views

Windows Batch-File to execute and communicate with running program

(How) can a program with interactive command line mode (shell) be programmatically "interacted" with from CMD.exe via batch file (.bat)? Example: >program.exe >>aCommand >>...
1
vote
0answers
33 views

Error level always 0 in batch file [duplicate]

I'm trying to set up an automated deploy script from a windows image. During testing, I'm running into an issue regarding the the part that tries to catch if something went wrong with certain commands....
0
votes
3answers
62 views

How to echo a txt file with list of file names in each folder

Let's say I have folder A and Folder B. Folder A has files A1 and A2. Folder B has files B1 and B2. I want to create a text file in each folder that list the files in that folder. So create fileA.txt ...
0
votes
0answers
89 views

Correct convert batch file from vlc command line

I am using VLC to transcode stream from enigma2 satellite Dreambox to be able to watch my channels over the Internet anywhere. If I set up VLC by GUI all is ok working. Because it is too much steps to ...
0
votes
1answer
65 views

Encrypting the password value used to send an email via a bat file?

I want to send a file to my Gmail account via a bat file and encrypt my email info in that bat file so that if someone opens the bat file they cannot get the email information from it. My Script I'm ...
0
votes
1answer
37 views

How to force an application to use a specific network card?

So let's say i have multiple network cards, each of them connected to a different router & ISP. how can i force an app to use a specific connection? when i enable all the connections in windows ...
1
vote
1answer
44 views

Extracting filenames from svn console output

My Tortoise SVN SVN update command generally returns me this output: C:\proj>svn update Updating '.': A 'some-file1.txt' D 'some-file2.txt' Restored 'some-file3.txt' U 'some'file4.txt' C 'some ...
0
votes
0answers
29 views

Taskschd.msc -.bat won't write to file

Have a .bat file set to run at logon in taskschd.msc. Have confirmed that it runs at logon (.bat and window appears). However, it isn't writing to the .txt file as one of its functions. It works ...
1
vote
1answer
86 views

How to pass Ctrl+C to script called from batch job

I am trying to avoid the effects of pressing Ctrl+C in a batch file somewhat similarly to How to supress "Terminate batch job (Y/N)" confirmation?. However, in my case, I want the signal to ...
1
vote
0answers
59 views

how can i send an attachment to an email address using a bat file without using my password? [closed]

here's what i want i have an gmail account( i don't mind having any other account if this will work ) and a file /folder and want to send it to my own email using a bat file without using my ...
0
votes
0answers
33 views

Program not executing in batch script at startup

I'm trying to run HDDScan-3.3 in a batch file at computer startup through "Local Group Policy Editor". I want to change some power management behaviours for an external hdd as silently as possible. I ...
0
votes
1answer
198 views

Send a file to an email address using a bat file without exposing the email info?

I want to send a file to my Gmail account via a bat file and encrypt my email info in that bat file so that if someone opens the bat file they cannot get the email information from it. Logic such as: ...
0
votes
2answers
57 views

Feature history of windows command prompt

I am preparing a Windows BAT script that uses some new features like setlocal and group of commands in FOR loops like for %%a in (a b c) do ( del %%a.bak ren %%.a %%a.bak ) I would like to ...
0
votes
3answers
144 views

Batch file or command line for removing header lines from text files

I am trying to remove the first 3 lines from 10,000 text files. Using: for %f in (*.txt) do more +3 “%f” >> output.txt I am able to remove the headers and concatenate all files in the folder ...
0
votes
1answer
77 views

How to use a batch script to zip files with unique passwords?

Good day. I was wondering if there is a way to write a batch script that converts files into password-encrypted zip folders (each zip folder will have a unique password)? I have seen several ...
0
votes
0answers
15 views

Avoid “Confirm Execution” message when running a batch file on a network machine

I use a few batch files on my Network laptop. Each time I run a .bat I get a "Confirm Execution" dialog box with my domain name (already input) and password. Then I will have to enter my password, ...
0
votes
1answer
37 views

Password protecting a program without third party software with an encrypted password on windows 7 Enterprise?

Been testing it for a few days now and my original idea was to use a .bat file to ask for an input, the problem is that the password is not encrypted and therefore I can't use it as it is now. Found ...
0
votes
0answers
71 views

Running a long single line batch file containing files in a folder

I have a folder with over 2,000 files. I want to merge these files using a software called CloudCompare with the command line. The problem is that a single line cannot be over 8191 characters as per ...
1
vote
1answer
32 views

wmic result to named text file

I am writing a batch script to install software that is 32 or 64 bit dependent. I am using "wmic os get osarchitecture" to determine the architecture of the Windows OS. What I am looking to do is ...
0
votes
1answer
99 views

Batch Script - Run as admin changes %username% parameter

I have made a batch script, which contains various %username% fields in it. It needs admin privileges to run some commands, but when I do this all of the %username% fields that need admin to run get ...
4
votes
2answers
57 views

Search for most recent file under a directory and copy the folder containing it to another directory

In my directory I have many files with the same name also in many other subdirectories example file structure: C:\a\first\hello.txt C:\a\second\hello.txt C:\a\third\hello.txt I need to ...
1
vote
2answers
42 views

Get files sorted without extension in batch

I would like to have an option to get all the files in the folder, just the names (no path and no extension) and sorted by name, in a simple batch file. I know how to get all the names, but it's not ...
0
votes
2answers
45 views

Extract Text from in front of, after, and inside characters

I have a variable (%~1) set to something like: Hello there this is a block: [C]Inside of Block[/C] Did you like it? I want to have it separated into three variables: Front=hello there this is a ...
2
votes
1answer
32 views

Schtasks.exe with quotes

I use this command to create a task: schtasks /Create /TN ITCMD-CHAT-NOTIF /SC ONLOGON /tr "%cd%\Notif\Notif.vbs" /F However a problem occurs. When there is a space in the path it still does not put ...
1
vote
2answers
273 views

Ping ip address and save result to txt file.

I am trying to open a list of ip address and ping them and then save the responce to a TXT file. The ping loops through and runs with out a problem and reports correctly but i can get it to save the ...
2
votes
1answer
49 views

Windows Batch & VLC Issues

Currently I am attempting to write a batch file that recursively converts all .wav files in my folder into .ogg files and places them into a folder on a different disk using vlc's command line ...