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
0
votes
1 answer

How to change AWSTATS configuration via cli

My Apache log files have the date included in the name and I can't change this. Is there a way to change the LogFile config parameter for AWSTATS using Windows CMD prompt? Better yet a batch script? Of course I can try to find and replace what I…
d.lanza38
  • 357
  • 1
  • 6
  • 13
0
votes
1 answer

Extract portion of text file between blank lines via batch

I need to be able to extract a portion of a text file that occurs between two blank lines. The text file looks something like this... This is line 01 of the text file. This is line 02 of the text file. This is line 03 of the text file. This is line…
user3208239
  • 109
  • 1
0
votes
1 answer

Robocopy: How to copy assets from multiple locations to a single location and maintain a log

I have multiple folders containing assets (each folder has subfolders containing these assets .mp3, .txt, .png, etc). I want to copy all this assets along with the subfolder to a single location/folder. I was able to successfully run a robocopy…
0
votes
0 answers

Windows batch command equivalent of "curl -s -L http://j.mp/script.sh | bash"

I would like to run a batch script that calls another batch script hosted on the internet. In bash, this can be done using something like this: curl -s -L http://j.mp/script.sh | bash How can I achieve this in windows batch. I have busybox and curl…
alxbrd
  • 107
  • 5
0
votes
1 answer

Adding File Server to Trusted Sites through REG ADD Command

I'm trying to add a trusted site to a group of Win 7 computers that need to run batch files without security prompts. Adding the file server to trusted sites allows them to run. I don't want to manually add the site to 100 computers so I'd like…
Copy Run Start
  • 734
  • 1
  • 9
  • 27
0
votes
1 answer

How do I set variables in bat file and pass them to php variables?

I am working on a script in Windows to get system information , I want to store the result of each command in a bat variable, then pass them to php variables. Here the script that I tried: for /f "tokens=1 delims=[" %a in ('ver') do SET OS=%a for…
Asis
  • 21
  • 2
  • 5
0
votes
1 answer

Batch script to increment the text file ans also the value inside the file

I have a text file Foo.txt which contains value content0. I have to create a batch file which increment the text file like Foo1.txt, Foo2.txt.....Foo5.txt and also the values in the file content1, content2,...content5. The Foo1.txt should have the…
Sindhuja
  • 9
  • 2
0
votes
2 answers

Bat script start a program and than restart

I need some help creating a .bat script that starts a program and when done it restarts the computer. cmd /c C:\"Program Files"\"Toolwiz Time Freeze"\ToolwizTimeFreeze.exe /usepass=password /freezealways This is what is should do first. This works…
Saeed
  • 366
  • 3
  • 11
0
votes
1 answer

Testing MySQL 32-bit ODBC connection via CMD

I'm going to make a batch script to do some basic troubleshooting. Among other things, I want to test 32-bit MySQL ODBC's for connectivity. This script will run locally on each workstation. There doesnt appear to be any option in odbcconf.exe for…
Ken Ash
  • 11
  • 1
0
votes
1 answer

Shut down syspro 7 processes

We have nightly backups run on our Windows Server 2012 R2 sys pro 7 server. Having the syspro processes running during backups can cause file lock issues and other errors. Does anyone know a way we could automatically shut down our syspro 7…
Adam
  • 87
  • 1
  • 1
  • 4
0
votes
2 answers

Checking file properties in a batch script?

I have a batch file from a vendor to patch some software on a Vista machine. I'm going to be using GPO to push it out as a startup script. My problem is some systems require this software and some don't. I'd like to add code to the beginning of the…
MathewC
  • 6,957
  • 9
  • 39
  • 53
0
votes
1 answer

get files from a shared folder with password from a anohter computer with batch file

I'm using a .bat file to get some files from a shared folder on another computer in the same network. My challenge is that the shared folder is password protected. Is there a way to write username and password in a batch file when getting files from…
Zhenyu
  • 263
  • 1
  • 3
  • 10
0
votes
1 answer

Windows - How to redirect all console output to text file? The console program is called by another software that I can't control

It is a pretty complicated issue (at least for me). GUI software at a given moment, calls console software, which outputs something to console and quits. I'd like to save those results to a text file, but I can't call the console software myself. Is…
0
votes
1 answer

I am unable to set the owner of a folder back to the user from my bat file

The following bat file is being used to fix permissions for Users in our organization. Everything works perfectly until we try to set the owner back to the user. takeown /F F:\Users\First.Last /R icacls "F:\Users\First.Last" /grant:r…
software is fun
  • 306
  • 3
  • 6
  • 14
0
votes
0 answers

Error: "Parameter is incorrect" when opening 0b bat/cmd

Having sort of issue that is more likely annoying when need to create short batch script (though it's not scripting issue). I want to right-click on desktop and create new text file. Rename it and make it's extension as .bat (or .cmd). Since this…