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.

learn more… | top users | synonyms (1)

1
vote
0answers
34 views

Remotely change local group policy server 2008R2

I'm trying to find a way I can edit the 'trusted hosts' list under local group policy remotely. Path from within Local Group Policy is: \local computer policy\computer configuration\administrative ...
1
vote
1answer
39 views

Push batch script to AD clients

Is it possible to force Active directory clients to run a specific batch script now (without having to restart their computer) ?
0
votes
1answer
6 views

How to catch “The system cannot find the file” within For /F loop

How to catch "The system cannot find the file" within For /F loop I would like my code to do the following; 1 - Search for the specified file 2 - If file not found, handle the "The system cannot find ...
0
votes
1answer
53 views

how can I download web pages from the command line in windows

Well, I'm trying to do some automation using batch file to speed up my daily routine at work, and I need to solve these little questions: I want to install wget command, but using only the pure ...
1
vote
1answer
65 views

Wevtutil equivalent for powershell script to get event logs

I have made a powershell script which is as below but since I won't be able to save it in .evtx format. I want the wevtutil equivalent(using wevtutil epl) for the same.Please help! ...
1
vote
1answer
55 views

Access denied running gpo logon batch script executing reg add/query

I am using MS Server 2012 R2 64bit with Active Directory installed. I want to execute a few batch scripts when the user logs into a computer. These scripts use the "reg add/query" commands to check if ...
1
vote
1answer
19 views

batch: how exit from for cycle without a label

is here a command to exit from a FOR without using a "goto label"? for %%c in (list) do ( [some code] for %%i in (1 1 100) do ( [some code] if [a condition] exit-this-for [some code] ) ...
0
votes
1answer
19 views

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? ...
3
votes
1answer
112 views

Windows Sensu client - occasional “Access is denied” errors when running batch files

We have the Windows Sensu client running on several 2008 R2 systems. One of our checks calls a batch file to gather some info and report back. We are sporadically receiving "Unknown: Unexpected error: ...
0
votes
1answer
105 views

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

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 ...
1
vote
0answers
23 views

How can I wait to the close of the uninstall panel in windows 7 from batch file?

I have simple batch file : @echo off call "c:\windows\system32\appwiz.cpl" echo "Done" On Windows XP, this batch launche the uninstall panel of windows, and block the execution until the use close ...
-2
votes
1answer
50 views

What does timeout /T > null mean in batch programming [closed]

What does timeout /T > null mean in batch programming. I mean I can't seem to figure out what > null means here. Sometimes it is also used for COPY [source file] [Destination file] > null
1
vote
1answer
94 views

psexec start program doesn't work

Id like to kill and start a program on a remote machine with psexec. I use the following batch-file (c:/users/user is psexec root) cd c:/users/user psexec \\computername cmd /c "taskkill /im ...
0
votes
0answers
79 views

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 ...
1
vote
0answers
21 views

DSADD in batch file - syntax incorrect! Same command in command works fine

Really stumped here and I'm sure the answer is simple. Simply put, I'm creating a bunch of AD accounts based on input from a spreadsheet. I've been able to concatenate the fields into a DSADD command ...
-1
votes
1answer
116 views

Script/Batch If Directory is a certain age then run .exe

I currently have a batch file that looks to see if a folder exists and then if it does it runs the uninstall exe within it and then installs the program with an msi. I need to alter it or just convert ...
-4
votes
0answers
51 views

How do I disable specific keyboard keys in batch? [closed]

I'm trying to figure out what to do to disable the following keys in a batch script: Ctrl Alt Windows Key Escape Delete (not Backspace) Pause/Break key Can someone help me please? It's so a ...
-4
votes
1answer
62 views

How do I utilize disk space in batch? [closed]

I'm trying to write a batch file that would kinda go like this: if DiskSpace > 255MB for C:, goto 1 :1 copy "E:\file.txt" "C:\destination\" It's for a program I assembled, and I needed to create ...
0
votes
0answers
17 views

icewarp automate extraction of smtp logs

How can we create a batch job to extract results of SMTP log search from IceWarp Log Analyzer and save it to desktop or some network drive or better send it via mail. We are using windows server 2008 ...
1
vote
1answer
56 views

user authentication with powershell

I have the following simple script which I'm using to push some files to a number of Win7 and Server2008 machines. In most cases the local user has no password. However the scripts fails because I'm ...
0
votes
0answers
56 views

log a SFTP batch process

I have a simple batch process which does SFTP a file to a SFTP server. The batch code for that is here: option batch abort option confirm off open sftp://server -hostkey="ssh-rsa 2048 ...
0
votes
1answer
241 views

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 ...
0
votes
2answers
106 views

logoff sessions except console

There is an application in a multi-user environment that can only be open in one session on a workstation. The users move around frequently from PC to PC, leaving the application open, and the ...
3
votes
2answers
305 views

Is there a way to change passwords on multiple servers simultaneously?

x3 Server 2012 R2, x2 Server 2012 My system has 5 servers; 1 Hyper-V server hosting 2 vm servers (these are the x3 2012 R2 servers), and a Win 8.1 pc running hyper-V that hosts 2 more vm servers ...
0
votes
1answer
244 views

Auto login in Windows Server 2012

I have a server which I connect to with remote desktop connection. I have defined auto login for a particular user. I also have scheduled a batch script to run after logon for that user. However, ...
0
votes
1answer
786 views

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

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 ...
1
vote
1answer
593 views

environment variable clientname scope on terminal server

I have a script that needs the CLIENTNAME environment variable, it runs on a terminal server. I have a batch file for testing that contains: set CLIENTNAME; pause If I RDP as an admin: If I open a ...
1
vote
1answer
31 views

From command prompt store a “!” from a file name in a varible

I have a set of files in a folder with names like test! - 01.avi. I want to make a new folder for each file with the same name and then move the file into that folder. I have everything but how to ...
1
vote
1answer
61 views

top batch to dump CPU usage for all CPUs

I am looking for a command that I can run in a batch mode and report back to a monitoring server. I'd like a CPU usage across all CPUs (the equivalent of running top in interactive mode and then ...
2
votes
3answers
106 views

How to see what last batch was run on windows

Is there a way to see what was the last batch (something.bat) run on windows? I was in a folder which contains lots of batches, as I was opening them one by one by right clicking and selecting ...
2
votes
1answer
114 views

Why does scripting with appcmd behave differently than using IIS GUI?

I've scratched my head raw on this. Please help me stop the scratching. We have a manual workaround for a site problem we're experiencing. The workaround always works when we do the steps ...
1
vote
2answers
861 views

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 ...
1
vote
1answer
89 views

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 ...
2
votes
1answer
175 views

Managing power options

For various reasons, we want our clients' computers to not sleep when on AC. We have been running the following script with moderate success: powercfg /change standby-timeout-ac 0 However, the ...
-1
votes
1answer
65 views

Delete files by date and character count

I have an interesting problem. I need to delete directories that are older than x days but are only numerical. We have a log folder that has log files that we need to delete but other files and ...
0
votes
1answer
134 views

Batch script to increment the text file ans also the value inside the file [closed]

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, ...
0
votes
2answers
434 views

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 ...
1
vote
1answer
123 views

How to get value of environment variable from passed command line parameter

I have to use/reference an environment variable value which will be passed as a command line argument. Something like below set myvar=%1 echo Value of %myvar% is %%myvar%% Here in %%myvar%% I want ...
1
vote
1answer
219 views

Add new dependency to a Windows Service that already has dependencies

I want to add via Batch script a new service-dependency to an existing service with old dependencies, without deleting these dependencies. I know the command sc config ServiceA depend= ...
-3
votes
2answers
54 views

Need assistance Creating special Batch file [closed]

I need help to create a batch file that will delete log files in D:/folderx on Server:\serverx This is to eliminate the manual process of cleaning up the disk to avoid a page out of low disk space. ...
1
vote
2answers
233 views

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

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 ...
2
votes
1answer
225 views

Can I permanently add to PATH in windows using batch?

Is it possible to permanently add c:/project/bin to PATH i windows using only batch?
1
vote
1answer
119 views

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: ...
7
votes
3answers
1k views

Determine if C drive has 2 GB of free disk space

I am trying to determine if a target pc has atleast 2 GB of free space. Here is what I have so far: @echo off for /f "usebackq delims== tokens=2" %%x in (`wmic logicaldisk where "DeviceID='C:'" get ...
2
votes
1answer
2k views

Can't run .bat file off share, but can from cmd

I have a smb share on a Linux box set up that I can view in explorer: \\XXX.YYY.ZZZ.QQQ\Share In this share is a batch file: \\XXX.YYY.ZZZ.QQQ\Share\Scripts\Script.bat I can open the file in ...
0
votes
1answer
106 views

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 ...
1
vote
0answers
173 views

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 ...
1
vote
2answers
1k views

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 ...