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.
I'm running some code in C# where I call a batch file, and I need to pass a Path with space as an argument and it does not work.
I have tried to call my argument different ways in the batch %1 , %~1, ...
I can't seem to open a new command prompt from a batch file in a different color
I have tried adding in the color command in different positions but it never opens the new command prompt in the color ...
I was trying to do some pressure test in which there are a few batch files with calling relationship between each other. A batch file would use 'Call' to start another batch file.
Considering that ...
I have a bunch of folders with names like this:
I need to copy contents of the latest dated folder into the name ...
I have an XML File, in which I would like to amend particular strings of text within elements based on different matching conditions which are detailed below.
It may take a while to read and ...
I have an XML File, I would like to delete a particular element based on a matching condition, then rename/renumber the elements that remain.
<AudioTracks> overall can contain a number of ...
echo There should be a newline%NL%inserted here.
I've looked at this article here on Stackoverflow, but it doesn't quite explain the ...
Quick note: This is on a windows environment.
I am working on a script to run femzip on all files and folders in a shared drive. I have a batch file that does something similar. Issue is, it is ...
I have hundreds of files I want to rename to match a new convention.
Current convention is AA.BBBB.XXX
I want to change it to BBBB.AA.XXX
I've cd'd into the folder which holds all of these files.
Im trying to make a script that the user need to fill 3 spaces in the same line.
Is it possibile?
For example filling a date: 25/02/2019 in this way: day here / month here / year here
Not line by ...
I am trying to write my first ever batch file that builds a React application (using node package manager) nested inside a SilverStripe project, and renames the js and css build files, and moves the ...
how to "echo" the value of (environment) variables that should expand environment variables themselves?
echo running test ...
set /a "YesPleaseContinue=0"
So I have a set of files that look something like this:
[text A] (space) "(" [text 2].extension
Joe (Nice Guy) (1993) (v.1).abc
Joe (Bad Man) (2001) (File B).xyz
I would like to do the ...
I'm trying to create a batch file to get the TeamViewer ID's remotely. The problem is that I'm not sure how to query the registry with another account. I have some code to show, but it doesn't really ...
I have a cmd batch script which:
reads from a file line by line
if the line matches the specified string, it outputs that line plus 2 new lines into the new tmp file
if the line does not match the ...
I have a set of data from my Student Information System and I want to change the username in the csv from test.student to an email address email@example.com that is in column D of the .csv ...
I am running a batch file that creates a CSV file fetch the data from Database, but the resulting CSV file starts with a blank line which causes me some problems.
Any way I can modify my bat file to ...
I need a batch file to move the second line of a csv format UTF-8.
The first line have the header and this can not be moved.
The paths of csv have space and are in different folder.
Csv format is ...
I am trying to run rsync from a batch file. The command is
SET CMD="rsync -P -rptz --delete -e 'ssh -i /root/.ssh/CERTIFICATE.pem' SOURCE_ADDRESS /mnt/c/Users/MYNAME/IdeaProjects/PROJECT/SUBFOLDER/...
I've made this code to change the date. But when i enter a wrong date, the errorlevel command appears beeing ignored.
@cd /d "%~dp0"
I have a .bat file to execute in a windows server 2012 R2 machine. Problem is that I need to add an "if not equals" but when I try to execute it the code does not work.
I know that problem is in the ...
Executing a java program from batch file that is having dependent externals multiples jars.
So, How to include those jar file.
Note :- while running java program fromeclipse. i am using -DINSTALL_DIR.
I am trying to copy a file to a folder using the following batch script
echo xcopy \\path1\file.txt \\path2\backup
However, I get the following error:
UNC paths are not supported. Defaulting to ...
I am not too familiar with Windows PowerShell (and Windows console commands in general), but I wish to write a batch file which can create sperated .zip archives from specific files in a folder, then ...
echo >"%temp%\%~n0.vbs" s=DateAdd("d",%qty%,now)
I exported registry keys to a .txt file using reg export command.
I cannot read this file using for /f.
I tried to change code page using chcp command although I didn't get any better.
When I change ...
So I'm trying to use double delayed expansion to rename files in a directory. The issue I'm having is using double delayed expansion with the SET command. This method works as expected with the ECHO ...
I am trying auto backup for mysql, and i write .bat file, it working (Only there is a warning in cmd "Using a password on the command line interface can be insecure").
After, i try set up win task ...
In Jenkins->Global Tool Configuration->MSBUILD
I Added a MSBUILD like below
Path to MSBuild: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\...
I need to delete the files whichever is newly created in that path.
In our case, we will have multiple files in a certain path. After running our application, it will create new files. I need to ...
I'm trying to start the Pandora windows application from the command line through a bat file using this command:
start "Pandora" "pandora:"
Every time i try it, regardless if i run cmd as ...
I have an XML file, containing the following:
I have a schedule task i.e mytask on 50of my computers(windows) and i am working on writing a batch file to delay the task by 2 min on all 50 computers, is this the right way to go about it ? I come ...
I have read many questions and answers about pushd here and on other sites, the overwhelming majority of them referring to issues with UNC paths. However, I've got a different problem I haven't seen a ...
This question is similar to that of Echo batch file arrays using a variable for the index?
but it doesn't answer my question.
I have a batch file that contains a list. I am iterating through a for ...
I tried to make a batch starting my .jar so it look´s better. But my .jar needs some native librarys and I don´t know how to set them threw my start batch.
I already tried to use the -Djava.library....
Looking for a bit of help here. I have the following batch file that I am looking to convert to powershell.
What it does is edit a registry entry remotely.
The lines are the following:
I am trying to access a password protected folder i created months ago but it isn't working.
I copied the code from the internet and made appropriate changes to it like password etc but now it just ...
I am trying to run
compile_command = r'"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/Bin\MSBuild.exe" "input/Applications/EPMD-Software/IpProtector/IpProtector.sln" /t:...
How to create filelist from folder but with randomised order? In batch. Is it possible in batch?
I need to run a .bat file from Windows Task Scheduler WTS.
If I run the .bat with double click it works. But it isn't working when launching from WTS.
On WTS my action is:
Let's say I had a batch file:
echo Would you like to open text.txt? (y/n)
if %cho%==Y goto OPENFILE
if %cho%==y goto OPENFILE
if %cho%==n goto END
if %cho%==N goto END
echo Invalid ...
I have a batch file that copies the most recent version of an access front-end file to the user's C: drive and then opens it from there.
For some users, the copy command causes the batch file to ...
I'm workin on a batch script that automatically copies all log files with a max age (n) to a new location.
While testing the script i noticed, that there some log files were missing and the reason ...
I have a variable %%p created from for /f command
When i try to use it with some additional references like: %%~dp and then write some text afterwards it accesses a different variable
Have the following code and wanted the result from powershell to be in aux_var.
(regular .bat file invoked from cmd)
powershell -Command "'%aux%' -...
I want to have the output file to have same name from source ( for eg first filename from list.txt), how can I do it?
This is the code I have which converts the all the .avi in folder to a single ...
In a certain path I have some different kinds of file type. Eg., .txt, .bas, .cls, etc.
I need to delete only the text files in that path except few files.
For eg, if the path has a.txt, b.txt, c.txt, ...
I am unable to do the batch decrypt of multiple files in a folder and post the output to another folder.
Anyone has a working solution for the same?
How should I correct my code?
for /r D:\Source %%i ...