Questions tagged [batch]

A batch file is the name given to a type of script file, a text file containing a series of commands to be executed by the command interpreter under MS-DOS and Microsoft Windows.

This was the first extension used by Microsoft for batch files. This extension runs with MS-DOS and all versions of Windows, under COMMAND.COM or cmd.exe, which execute its commands, normally line-by-line.

339 questions
1
vote
2 answers

RoboCopy A File From The Web?

Is it possible to download a file from the web using RoboCopy? What would the syntax for that be? Here's what I'm trying: RoboCopy "http://www.google.com/" "C:\some_folder\" "index.html" /L /V /E /LOG:"C:\some_folder\test_robocopy.log" /R:10…
Cory Dee
  • 121
  • 1
  • 2
  • 8
1
vote
0 answers

Windows file compare (FC) spurious differences

I'm getting differences like this: a.txt Betty Davis Cathy Edwards b.txt Betty Davis Cathy Edwards There are only two lines listed in the diff (which doesn't make sense). No CR/LF/Newline funnies. The…
user165568
  • 270
  • 1
  • 2
  • 9
1
vote
2 answers

batch file, delete line by number

i have this: set myvar = ^J | FIND /N /I "texttolookfor" %WINDIR%\system32\drivers\etc\hosts now i have the lines it fined the text in how can i delete these line from the file? i know i can run over the lines with FOR but the delete part is still…
Y.G.J
  • 317
  • 5
  • 14
1
vote
1 answer

Migrating ODBC information through a batch file

I am a desktop support technician currently working on a large scale migration project across multiple sites. I am looking at a way to transfer ODBC entries from Windows XP to Windows 7. If anyone knows of a program or anything prebuilt that already…
DeskSide
  • 13
  • 1
  • 4
1
vote
4 answers

How to "ignore" username and password prompt in net use

I have at the moment a logon.cmd script, that I'm using to map network drives to the users profile. It looks like this: ::Onboarding net use m: /delete net use m: \\BOB\onboarding ::Bookings net use n: /delete net use n: \\BOB\bookings…
Mattisdada
  • 57
  • 1
  • 2
  • 16
1
vote
1 answer

Batch file to uninstall windows update?

Is it possible to make a batch file to uninstall a specific windows update (eg. KBxxxxxx)? We use 20 year old web based software to enter hours where I work and a new update is causing the program to crash. The update was blocked on our wsus server,…
1
vote
0 answers

scheduledtask to update svn directory creates multiple processes

We have a fairly standard web setup, with a windows 2008 server hosting our website and the directories being under control of SVN, with tortoise SVN as the preferred provider. One of the SVN folders is our content delivery network, we need to…
1
vote
3 answers

Need to exclude a specific result from a Batch For Loop

I have a script that recursively loads files from a specific directory (and subdirectories) into a java classpath using a FOR loop. It looks like this: FOR /r directory %%F IN (*.jar) DO call :addcp %%F Unfortunately, I need to now exclude a…
Keith
  • 352
  • 3
  • 11
1
vote
2 answers

Batch - Ping IP and execute different commands on return

I'm trying to make (hopefully a simple) script that when run pings my mobile device. If the mobile is connected to the network it will execute one command and if not it will execute another. I've tried with the following command: ping -n 1 (The IP)…
Anton Johnsson
  • 11
  • 1
  • 1
  • 2
1
vote
1 answer

Task scheduler not running (Server)

I have written a simple bat file to copy .txt files from one drive into another one. I want this to run everyday at this time but the problem is when I'm not logged in to the server the task does not run. I have also selected the "Run whether logged…
user1383080
1
vote
1 answer

batch file infinite loop when parsing file

EDIT: Apparently I don't have enough rep to answer my own question, so the answer is going here. OKAY! SO! I didn't exactly solve the problem... but I stopped using cacls.exe and started using icacls.exe and now it seems to work again. The batch…
1
vote
2 answers

users unable to add registry keys to HKCU

I may not have this 100% correct so need some clarification. Are normal users on a 2003 terminal server allowed to add registry keys the their own HKCU section in the registry, or are they only allowed to edit existing ones? The reason I ask is that…
James Edmonds
  • 1,733
  • 10
  • 37
  • 59
1
vote
1 answer

Cacls, full permission, local names

I tried to use cacls to give "Everyone" group access to certain folder. And I failed. As I understand the reason is i'm trying to use groupname in english while my windows is localized. Attempt to use localized groupname succeded. I can't predict…
1
vote
1 answer

check for ping reply - unexpected result

I am running this within windows xp batch file: ping -n 3 10.1.1.2 >nul: 2>nul: if %errorlevel%==0 ( echo ping reply arrived ) else ( echo no ping reply. ) sometime, it seems like i get no ping reply although on a parallel cmd line…
Doron
  • 21
  • 4
  • 10
1
vote
1 answer

Single batch with different configuration for different machines

Is there a way I can have a single batch to run different configuration according to the Computer name ?
Eddy
  • 257
  • 3
  • 10
  • 22