i want to call a batch file from another batch file and also want to pass a variable to it. lets say i want to call b.bat from a.bat. my b.bat copies files. so while calling it from a.bat , i want to pass the path of the destination folder to b.bat.
well to b more clear, the destination path will b entered by user, so it will b stored in...
Hi,
I want to store the URL of all files with same extension in specific directory to one Log file. IS there any batch command available for this.
Exapmle
I want to copy all files with *.TXT extension into one log file with its directory extension(URL)
...
I have a batch file as follows:
myfile.bat
:: This is a sample batch file
@echo off
echo change directory to d: <---How to change color of only this line (comments lines)
CD d:\
...
...
I have a variable define as:
set filePath=".\file.txt"
I'm writing a windows batch file. Need to convert the path stored in variable 'filePath' to its fullpath (physical path).
How can I get the full path of this path? Please help!
...
This is related to my earlier question.
ren "C:\Temp\%%A" "%%A"
if errorlevel 0 (
"C:\Program Files\7-Zip\cmdline\7za.exe" a -tzip -mx9 "C:\temp\Zip\%%A.zip" "C:\temp\%%A"
Move "C:\temp\%%A" "C:\Temp\Archive"
)
In the above, the IF evaluates to true always, even if REN command fails.
The idea is...
The batch file is something like this, I put the python in some directory that has SPACE character in its path.
C:\"Documents and Settings"\Administrator\Desktop\bracket\python\python
C:\\"Documents and Settings"\\Administrator\\Desktop\\bracket\\[10,20]\\brackettest.py
When I run this one, I get this error.
C:\Documents and Set...
I'm trying to make a script that will place a list (in a .csv file) of processes that are running that take up more than 10 mb of RAM and shows the time + date the script was run. My teacher did this during his lecture but I can't remember how he did it. Just trying to figure out how to be better at IT.
So my question is, can anyone hel...
I need to create a batch file that goes to a directory and execute a series of executables
start cd c:\temp\
command1
command2
the above doesn't work, it only starts in c:\temp, but ignores rest.
...
So here's my issue:
I want to use %cd% so a user can execute a script anywhere they want to place it, but if %cd% contains spaces, then it will fail (regardless of quotes). If I hardcode the path, it will function with quotes, but if it is a variable, it will fail.
Fails: (if %cd% contains spaces)
"%cd%\Testing.bat"
Works:
"C:\Program...
Hi,
I want to make something like this...
:LoopBegin
if ???? goto End
some other work goes here*
gotoLoopBegin
:End
The "????" part should be a check that a file exists with the name "exit.txt" for example. If such a file exists in the current folder, I want the batch file to just exit. Is there a way to do this?
Thanks
...
Hi,
On many occasions I have dealt with passing batch files arguments with spaces, quotes, percents, and slashes and all sorts of combinations of them. Usually I managed to figure out how to accomplish what I want, but this time I am stuck. I have tried a couple of hundred combinations now and my head is starting to hurt.
I’ve reduced ...
When I use the following code in command prompt, it works fine. But when I use the same code in a batch file, nothing happens. My batch file simply consists of:
for %f in (D:\flexcube1,D:\flexcube2,D:\flexcube3) do xcopy %f D:\o\ /e
but it does not work. I don't understand it and I have to use a batch file to copy multiple files. An...
Hi,
In my pursuit of a solution to another environment-variable/batch-file related problem, I have once again come across a problem I have visited before (but cannot for the life of me remember how, or even if I solved it).
Say you have two BAT files (or one batch file and the command line). How can one pass an environment variable nam...
I want to run a .bat file when I close my Java application.
I try, but when I close Java app the bat file doesn't start.
...
At a certain time each day, I'd like my browser to pop open a tab to a certain URL.
My goals:
be able to set the URL from the scheduled task
use the default browser (rather than hard-coding it)
I can't seem to accomplish both of these goals at once. I'll post my partial solutions as answers, but I'm hoping someone will have somethi...
When using start /max program_name to start a bunch programs, how to focus on each program when it opens. For now, it open focus on the first program, and launch others on the back. thanks.
OS: Windows Server 2003
Program: any windows program, like notepad
PS. It will focus on newly opened program on Windows XP SP3, but not Windows se...
Hi I am trying to get a batch file to call an executable from the server and login. I have a monitoring program that allows me send and execute the script. OK here goes....
//x3400/NTE_test/test.exe /USER:student password
Now this doesn't work. The path is right because when I type it in at the run menu in xp it works. Then I manu...
HI all,
This is what i'm trying to do. I have a .bat file which takes in a argument which is nothing but a folder name. What i do first is go one level up (cd ..). Now in this directory i have 3 folders and each folders have sub-folders and have .class files in them.
What i want to do is recursively loop through the folders and get hol...
Is there a way to delete all empty sub-directories below a given directory from a batch file?
Or is it possible to recursively copy a directory, but excluding any empty directories?
...
I have a batch file with some commands that I need to run with my installer, but I'd rather a console not appear (in Windows). I'm executing the batch file from a WiX installer, via a custom action. I tried adding an @ECHO OFF to the top of the file, but that didn't seem to do anything.
Is there a way that I can run this batch file sile...