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
3 answers

icacls variables in batch file

I'm moving users to a new domain, file server and user name format. I'm trying to write a simple DOS batch to copy the data and set the permissions. X: is mapped to the old server and E: is the local drive on the new server. The input file is just a…
SteveH
  • 11
  • 1
  • 2
1
vote
1 answer

Backup databases from MS SQL Server 2008 Express database thru batch script

I need batch script to backup selected databases from Microsoft SQL 2008 Express Edition. Unfortunately MS SQL Server 2008 Express edition lacks of visual database backup tools called Maintenance in MS SQL 2008 Standard, thus We need a batch script…
integratorIT
  • 139
  • 1
  • 1
  • 11
1
vote
2 answers

Bat file in another account

I have a bat file which will delete files in some folder (Profile Folder). But i do-not have access to that folder. But another account has access to the folder. How to run a batch file from one account by login into the another account which has…
Jaison
1
vote
2 answers

Loop in a Windows batch file

I have a problem where I need to clone one virtual machine into several machines for production. The machines have names that is assigned by variables and a rdp port is also assigned by a variable. Both variables is increased by 1 at the end of the…
Dempa
  • 143
  • 1
  • 2
  • 9
1
vote
1 answer

Rename NTFS file to eliminate multiple periods via batch

I at wits end trying to rename NTFS files that have technically legal, but problematic multiple periods in my Windows 2012 Server share Files are dropped in a share that look like this: THIS.IS.THE.FILE.NAME.20150102 …
1
vote
0 answers

Powershell-Script is not exectued correctly

I have a power-shell-script which is called by a batch-file. The batch calls the script after it has set the execution policy to unrestricted. Currently the script does nothing more than writing a log-file, logging that it has been executed. Now the…
1
vote
2 answers

Disable NIC advanced properties in Windows server 2008/2012

I have some Rackspace VM's and need to disable these advanced NIC properties: Correct TCP/UDP checksum value IPv4 checksum offload Large receive offload Large send offload version 2 TCP checksum offload UDP checksum offload Now i need to do this…
ccamacho
  • 213
  • 4
  • 10
1
vote
1 answer

if exist !SOMEPATH! not working in batch file

I have a batch script in which i am using multiple if exist statement, the problem is all statements are working except one . Following variables are set SETLOCAL ENABLEDELAYEDEXPANSION SET basedrive=E: SET tfworkspace=!basedrive!\TFS SET…
akash
  • 333
  • 1
  • 10
1
vote
1 answer

Running multiple instances of a Batch file in windows simultaneously?

I have a windows batch file that is invoked by windows scheduler. When I try to have multiple windows scheduler tasks trying to run the batch file simultaneously, the batch file is locked by the first process and the all the other instances fail. Is…
1
vote
4 answers

Robocopy fails in Scheduled task with ERROR 1326 Logon failure

My aim: To simply mirror a database backup directory onto another server Approach: Use Robocopy statement contained in a scheduled task robocopy "C:\MylocalDirBackup" "\\MY.IP\DatabaseBackupsShare" /mir /z…
reticentKoala
  • 111
  • 1
  • 1
  • 3
1
vote
1 answer

windows xp - how to add a ipp printer by batch/vbs

I need to deploy printers using IPP in the logon script (batch/vbs). I found the following script to do this: rundll32 printui.dll,PrintUIEntry /if /q /b "r011-printer01 " /f %windir%\inf\ntprint.inf /r "http://10.0.0.1:631/printers/r011-printer01"…
Zulakis
  • 4,153
  • 14
  • 48
  • 76
1
vote
2 answers

computer startup script reporting success to a server

I am using Group Policy to deploy a computer startup script that tries to uninstall one program and install another. I need this script to report its status (whether a certain file exists on the system, which would mean that the installation…
1
vote
1 answer

Batch script to create home home directories from list of names

I'm trying to create a home directories with permissions from a text file. I can only get the batch file to run the first line. Can anyone tell me why? I initiate the scripts by running go.bat as administrator. go.bat @echo for /f %%a in…
Steven
  • 63
  • 1
  • 6
1
vote
1 answer

Batch script terminates too soon

I need some help with Windows batch/CMD scripting. I wrote a script to record mic-in to a MP3 for 12 hours. It runs ok when running it manually. It will run with task scheduler too - just that, instead of waiting for 12 hours, it will terminate…
1
vote
1 answer

Ninite with a logoff group policy script

I'm trying to use a batch script to automate the updates of some apps using ninite with a group policy log off script. Here is my script: echo Copying ninite mkdir C:\temp mkdir C:\temp\ninite echo STARTING robocopy /xo /"\filesever01\shared…