This is my code so far:
for /f "tokens=1 eol=," %%f IN ("1,2,3,4") do (
echo .
echo %%f
)
I'm expecting that to produce:
.
1
.
2
.
etc...
But instead I get:
.
1
And that's it. What am I missing?
...
I have a portable development tool that I want to use on other PCs. I'd like to set a file association so that clicking a file opens the tool. Then, when I'm finished, I want to undo or reset the file association on that PC.
Is there a way to do this? Possibly from a batch file?
...
I am trying to write a little script that will help my office automate the uploading of zips and self extractors to a ftp site. They have to create several zips/se's and name them various different things etc.
My idea is for them to have a little table they could type in (i.e. the name they want the file to be called, the location of...
I have the following Batch file... When I run it in a normal command prompt - it runs as expected... Find that the server and destination exist, and does the backup and exits.
When I run this using the task scheduler - it sends the email that it cannot find the server, but still does the backup... Can anyone shed some light on this?
I'...
In a program am getting one input say name....
From a file i read value line by line:
say file contains...
hello
hai
If i want to print like
hello name in batch file
hai name in batch file
How to do this?
...
How would you implement logical operators in DOS Batch files?
...
I have a batch file that tries to run the program specified in its first line. Similar to Unix's shebang:
C:\> more foo.bat
#!C:\Python27\python.exe
%PYTHON% foo-script.py
C:\>
What I want to know is: is there a way to automatically set %PYTHON% to C:\Python27\python.exe which is specified in the first line of the script following the...
I'm having difficulty executing a batch file in Java that expects parameters. These parameters may contain spaces so I need to wrap them in quotes. I will also need to do the same thing for Linux because some of the parameters may contain special characters such as !.
Non-functional Windows code:
ProcessBuilder pb = new ProcessBuilder(...
Hi, I'm trying to write a small app which can be used in order to log off Citrix Sessions.
Citrix Sessions can be logged off via cmd or a batch file using this method:
@echo off
echo "Enter username"
set /p UserName=
echo 001
query user %username% /server:server1
echo 002
query user %username% /server:server2
echo 003
query user %user...
I've got an input to a batch file that contains a list of files (this is all one line and one of many inputs to the bat file):
"\\Server\my directory name\subdir,\\Server\my directory name\subdir2,\\Server\my directory name\subdir3"
I'd like to iterate this list and perform a command on each directory in the list. However, when I spec...
Hi,
I'm running Apache 2.2 (launched via console) on Vista. I have simple batch script in cgi-bin. Unfortunately, Apache does not seem to serve any content generated by sub-processes.
For example, given the following script:
@echo off
echo Content-Type: text/html
echo.
echo Visible in browser
cmd /c echo Hidden from browser
echo End o...
Hello!
I'm trying to delete some files with unicode characters in them with batch script (it's a requirement). So I run cmd and execute:
> chcp 65001
Effectively setting codepage to UTF-8. And it works:
D:\temp\1>dir
Volume in drive D has no label.
Volume Serial Number is 8C33-61BF
Directory of D:\temp\1
02.02.2010 09:31 <D...
Hi,
The following command in a batch file does not work as expected/hoped:
echo %~nxs1
Here is a sample display of what I’m trying to get:
C:\>type test.bat
@dir /b %1
@echo %~nxs1
C:\>test "C:\Documents and Settings\All Users\ntuser.dat"
ntuser.dat
NTUSER.DAT
C:\>test "C:\Documents and Settings\All Users\ntuser.data"
ntuser.d...
Hi Everyone,
I'm creating a batch file for SharePoint deployment. The batch will do solutions installation and configuration, create a web application and restore the .dat file on the created web application.
Instead of hard code the solutions path and .dat I want batch to know it is on the root. So, if I move this folder somewhere els...
is it possible to create a batch file to copy a folder to another location everytime I login, or when the folder is updated?
It could be written in vb or java aswel if not an easy solution.
Any ideas? Thanks
...
Hi All,
I have written following code
setlocal
set /A sample =1
:first
type C:\test.txt | find "inserted"
if %ERRORLEVEL% EQU 0 goto test
if %ERRORLEVEL% EQU 1 goto exam
:test
echo "testloop" >> C:\testloop.txt
set /A sample = %sample% + 1
if %sample% LEQ 4 goto first
:exam
echo "exam loop" >> C:\examloop.txt
endlocal
b...
Hi All,
I want a batch script which will extract the first 30 characters from a file.
Requirement:
there is one file called test.txt and it's content is
\765514e2aad02ca658cc56cdb7884947 *E:\test1
now I need a script which extract only \765514e2aad02ca658cc56cdb7884947 from the above file
Thx in advance
...
Hi All,
Is it possible to change the font color of text while redirecting it to WordPad?
Examples:
C:\echo greencolor >> C:\colors.rtf -----> This text should appear green in WordPad
C:\echo redcolor >> C:\colors.rtf -----> This text should appear red in WordPad
C:\echo browncolor >> C:\colors.rtf -----> This text should appear brow...
Hi All,
here is me requirement.
I have one text file and I need to get exact specified string from that file
C:>type small.txt | find "small2"
small2
small22
small20
C:>type small.txt small2
small22
small20
C:>type small.txt | find "small2" small2
small22
small20
C:\
Here it is giving all the words instead of only "small2"...
I need to make a batch file that can copy files from one path to another based on parameters.
For example, typing "datecopy -m 8 c:/copyfrom/*.* d:/copyto/*.*", would find all files in c:/copyfrom dated less than 8 months old, and copy them to d:/copyto -folder. Alternately, instead of -m for month, I could use -h for hour or -y for yea...