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)

0
votes
0answers
8 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 ...
1
vote
2answers
208 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
votes
0answers
9 views

need to get desired data from string using batch [on hold]

i need to extract only URL and app id in the given string and saved in variables url:{ "url":"ad.ifwcash.com/www/delivery/afr.php?zoneid=127&cb=2015738640", "app":61} final result like ...
0
votes
1answer
18 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
36 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 ...
0
votes
2answers
2k views

Server 2008 issue running batch file

For the life of me, I can't seem to get a batch file running in Server 2008 Task Scheduler, despite it not having the common problems I've seen before. Problem so far: I have a batch file that ...
11
votes
6answers
13k views

Program does not run properly as Scheduled Task

Situation I have a batch script that prepares some files, executes a program (.exe) and then deletes said files. This task should run hourly, so I'm trying to configure this using Scheduled Tasks. ...
3
votes
2answers
166 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 ...
1
vote
1answer
2k views

rsync unexplained error & received SIGINT, SIGTERM, or SIGHUP

I created a batch script to back-up our server: #!/bin/bash user=$1 # create user dir ssh root@local.backup.tst -p 5774 mkdir -p /var/backup/server.tst/incremental/$user # backup mail dir rsync ...
8
votes
8answers
27k views

Need leading zero for batch script using %time% variable

I came across a bug in my DOS script that uses date and time data for file naming. The problem was I ended up with a gap because the time variable didn't automatically provide leading zero for hour ...
0
votes
1answer
77 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, ...
1
vote
1answer
24 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
87 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 ...
0
votes
1answer
123 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 ...
2
votes
1answer
76 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
1answer
34 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
64 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
14answers
39k views

Finding day of week in batch file? (Windows Server 2008)

I have a process I run from a batch file, and i only want to run it on a certain day of the week. Is it possible to get the day of week? All the example I found, somehow rely on "date /t" to return ...
1
vote
1answer
55 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 ...
1
vote
3answers
2k views

How to work with batch script dialog?

I am working on a batch script to remap a network drive in windows xp. I have found it to work out well for the most part with: net use G: /delete net use G: \\file\share However, if there are any ...
2
votes
1answer
81 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 ...
0
votes
1answer
75 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 ...
-1
votes
1answer
51 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
78 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, ...
1
vote
2answers
129 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
2answers
133 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 ...
12
votes
5answers
19k views

How do I extract all archives in the subdirectories of this folder?

How do I extract multiple archives in contained in subdirectories in a folder, outputting the results back into the folders where the archives are.
1
vote
1answer
43 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
0answers
141 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
609 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 ...
-4
votes
2answers
46 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
1answer
87 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= ...
0
votes
2answers
1k views

Transferring files from ftp to local system

I want to copy a file from FTP and paste it to my local system. I want to run this through a batch file. I am trying this for a week. But I couldn't find the solution. Anyone help me please.... This ...
47
votes
3answers
108k views

How to sleep in a batch file?

How to pause execution for a while in a Windows batch file between a command and the next one?
0
votes
1answer
446 views

How to use a freshly installed environment variable in Windows

When I set an environment variable through the setx command in Windows 7, the variable is correctly set but if I type in set, it list the environment variables that were set at the script start up, ...
2
votes
1answer
122 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?
0
votes
4answers
6k views

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" ...
1
vote
1answer
77 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: ...
6
votes
2answers
672 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
3answers
3k views

How to put DayOfWeek value into file name?

I would like to use the numerical part of the output of "wmic path win32_localtime get dayofweek" to number backup files. Something along the lines of: FOR /F "tokens=2 delims=\n" %%DoW IN ('wmic ...
2
votes
1answer
1k 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
64 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 ...
0
votes
4answers
20k views

Command Line Winrar & Batch Scripts

I've written a wee batch script to backup some stuff on my desktop and dump it over the network to a share... The only thing that's bugging me is the verbosity of rar.exe while it's doing the ...
7
votes
4answers
19k views

How to create a never expiring password & user via net user through .bat file

I am using a .bat file to create a user and password at windows operating system level. The issue am facing is when i pass EXPIRES:NEVER for password, when the user is created, it doesn't have ...
16
votes
3answers
83k views

For Loop counting from 1 to n in a windows bat script

I need to run a windows command n times within a bat script file. I know how to do this in various programming languages but cannot manage to get it right on the windows command line :-( I would ...
2
votes
1answer
254 views

How to remove directories using wildcards by reading a file using batch?

Batch file for /f "delims=" %%f in (7profiledeletelist.txt) do rd /s /q "%%f" PAUSE exit 7profiledeletelist.txt C:\Users\1* C:\Users\2* C:\Users\3* C:\Users\4* C:\Users\5* C:\Users\6* C:\Users\7* ...
2
votes
3answers
3k views

Batch script to export info from Active Directory (name, phone numbers, location, etc) into a csv file

The secretary at my work uses a spreadsheet that lists names, phone numbers, and locations of employees to look up info if someone asks. All this info is located in AD, but the problem is that we are ...
0
votes
2answers
3k views

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 ...
0
votes
3answers
4k views

Is there a way to reset the password for a list of Active Directory users en-mass?

I have a list of user accounts that need their password reset to a default password (also users will be required to change the password at first login). Is there a way to reset the password for a list ...
0
votes
1answer
217 views

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