Tagged Questions

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
1answer
141 views

Windows batch find folder if statement

Assume a file system with the following format Folder A --->Folder 1 --->Folder 2 --->Folder 3 etc.. Folder B --->Folder 4 --->Folder 2 --->Folder 3 Folder C --->Folder 1 --->Folder 2 --->Folder 3 ...
2
votes
1answer
819 views

Batch - how to copy file by minimum size and date modification?

I have this simple batch script which copies the newest file in some dir to another place. I want this script to also ignore all files (in the DIR command section) under 1GB of size. FOR /F ...
1
vote
1answer
897 views

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

Powershell script on the hidden file share not accesible on the workstation

We have a PowerShell script script.ps1 on a hidden shared folder \\Server\Share$. We have a bat file Initiator.bat, which executes the script. The shortcut to the batch file is placed on the user's ...
1
vote
1answer
554 views

Start /WAIT RDP FIle in Windows 8

I am not sure if I should post this one here or in StackOverflow. I want a BAT that opens a RDP connection file and then, when the connection is closed, logoff the machine. start /WAIT ...
0
votes
1answer
895 views

How do I delete a remote file using NCFTP (Windows client)?

With ncftpput.exe how do I delete a remote file once logged in? I have tried using the -W option to send a Raw FTP command but cannot get it to work. Has anyone got a working example? Have tried ...
1
vote
2answers
1k views

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

“Access is denied”, only when trying to run script over telnet

I have a batch script that restarts a Windows Service with: Net stop <servicename> Net start <servicename> I got around having to manually run it as Admin by creating a shortcut to it ...
0
votes
1answer
1k views

Running a batch file from PHP - interactive services detection? [closed]

I am having a very hard time getting an executable to run from within a PHP script (using exec(), or a number of other PHP commands I've tried). The issue seems to be coming down to a question of ...
0
votes
0answers
120 views

Registry Export Using Script Run from CD Fails - Access Denied

I've written some scripts and .bat files to configure XP machines and I have created a CD with all these scripts on and execute them through a single setup.bat file which is also on the CD. One of ...
1
vote
0answers
107 views

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

Automatically restore windows network drive (red “X”) via batch file

i need check if a network drive is mapped and accessible. From time to time windows displays a red X on the drive, and i would need to manually click the drive in explorer to reconnect. I already ...
1
vote
2answers
298 views

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

Exporting Windows Registry settings by batch file

I am writing a batch file to migrate certain settings from one windows machine to another. I'm having problems with the regedit /e switch. In the script, I'm exporting ODBC system entries and ...
1
vote
3answers
1k views

How can I hide ms-dos window when running a .bat file?

I am running a .bat file for my script (Scheduled Tak (CronJob)) per minute. When it run, seems ms-dos window short period of time. My batch code like this; @ECHO OFF C:\wamp\bin\php\php5.4.3\php.exe ...
1
vote
1answer
1k views

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

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 ...
3
votes
2answers
9k 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 ...
1
vote
1answer
171 views

How to dump certificate file from installer via command-line?

I'm building a script that will download and install a bunch of programs. One of those programs depends on a virtual driver, which needs its certificate to be imported in order to function. Normally, ...
30
votes
3answers
61k 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
3answers
3k 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 ...
2
votes
1answer
527 views

Checking .BATs exit code with NAGIOS?

I currently have the following script on a Windows Server: @echo off set path=%PATH%;C:\UnxUtils\usr\local\wbin cd /D Z:\videos forfiles /M *_1.mkv /D +%date% > C:\mkv.txt >NUL 2>&1 ...
0
votes
0answers
716 views

Automate Sql Server 2008 R2 Express install - silently and pre-configured

I want to create a .MSI installation of my app. One of the things that should be installed it's the SQL Server 2008 R2 Express, but i want it to be installed silently, pre-configured for all client ...
1
vote
2answers
801 views

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

Automatic backup from SSH-server [closed]

I am in needed of a script (. Bat) who log on to an SSH server, and perform a backup of my mysql database with the help of mysqldump. This is to be run on a Windows computer and run three times per ...
2
votes
1answer
454 views

How does the “Last Result” column of Scheduled Tasks in Windows Server 2003 get set from a process or script?

The Last Result column of the Scheduled Tasks Window on Windows Server 2003, displays the result of the execution of the .exe, .vbs, .ps1, .bat, .cmd, etc... that has been run at the scheduled time. ...
4
votes
1answer
5k views

Batch script to test if a folder exists fails when checking a UNC path

I've written a small batch file to help us with a server migration to remap user directories using GPO. However in the batch file I'm having a syntax problem that appears right but it's still ...
2
votes
4answers
562 views

What is the efficient way to backup large files?

I have the schedule job of backing large files in Windows Server and it takes almost 2 hours to finish. For now, I only use copy command in the .bat and copy the large files to another folder. I'm ...
1
vote
0answers
142 views

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 ...
2
votes
3answers
706 views

Using a for loop in Microsoft cmd.exe, how can I process only the files with a certain extension?

I have a the folder c:\test\ and two files in it a.txt and b.txtv. I would like to process just the files with extension equal to .txt. If I write this commands cd c:\test for %f in (*.txt) do echo ...
0
votes
1answer
85 views

How to remove a line in a file found in multiple directories

There is file that exists in each user profile directory and I need to remove the line from the file in each user profile directory. I'm using a batch script to go through each user profile directory, ...
-1
votes
1answer
1k views

How to do a Batch file that get all files in a directory and zip it?

i would like to know how to get all single .bak (or anyother extension) files into a directory, and zipping them (one by one) and save them using the same name, changing only extension. Thanks
-1
votes
3answers
216 views

creating a bat file or cmd

I wish to create a bat file to create some basic task. When i run this it closes the window. I'm guessing it errors. How can i stop the bat closing the window so i can view the error. mybat.bat: ...
0
votes
2answers
2k 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 ...
3
votes
1answer
512 views

trying to copy security groups to a user using dsmod group utility in AD

I am trying to create a batch file that asks to enter source samid and destination samid. Then using dsquery and dsget find out what security groups source samid is assigned to and assign destination ...
1
vote
1answer
224 views

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

How do I run bat file inside cmd using tash scheduler

How do I run bat file inside cmd using tash scheduler. I've tried this one C:\windows\system32\cmd.exe C:\synchronization.bat And doesn't working.
2
votes
2answers
156 views

Change windows group permissions without the sufficient rights in a batch

I wrote a batch file, which creates multiple folders und subfolders in the current directory. The group permission of one folder is also changed. This works on my local workstation with administrator ...
1
vote
2answers
1k views

delete all folders with tmp in name using batch file

Have tried to google this, but I always seem to get results relating to .tmp files, which isnt really any use. I have only a basic understanding of batch files, but I think I need something like ...
-1
votes
1answer
132 views

Virus creates exe files with text content [duplicate]

Possible Duplicate: My server's been hacked EMERGENCY Something automatically creates exe files like "zytudou.exe" on my PC with text content: open 122.138.203.175 123 123 get ...
1
vote
1answer
965 views

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

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

Why does robocopy take 8 hours to transfer one files that is 70-80gb?

We have a scheduled task that runs every night and copies a file of around 70-80gb from one server to another on our network. For some reason it has been taking ~8 hours to do this, which is a problem ...
1
vote
1answer
231 views

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

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

Create Batch file to execute multiple batch files and VBS files

I have multiple batch files and vbs files , when i try to create a batch to call them it stop after the last batch file and dont execute the vbs. without giving any error if i put the vbs at the ...
1
vote
1answer
766 views

How to restart atd without affecting running jobs?

Does anyone know how to restart atd without affecting current running (batch) jobs? I guess I could move the jobs out of the spool directory and wait for the current running jobs to finish, but I'm ...
0
votes
1answer
655 views

Why does BitsAdmin.exe not finish a download and leaves just a tmp file?

Still learning how to use BitsAdmin.exe in batch files. Here is my script, which fails to finish downloading a file, and leaves just a temp file called "BIT851.tmp" on my desktop. Any idea what I am ...
-1
votes
1answer
505 views

Copying a set of local files to ftp

I want to copy a set of local files to ftp://124.30.124.230 (it will ask for a username and password). I want to do this work on 400 systems so I have planned to do this work by creating a batch file ...
1
vote
1answer
251 views

How to issue an rsh command in the background?

How to issue an rsh command to run in the background? Example: within a batch file i call rsh 10.1.1.2 -lroot /etc/rtcinst/myscript.ksh which runs on a remote unix machine. This script takes a ...