1
vote
0answers
16 views

Losing stdout when process restarts itself in windows

I have for example a NodeJS process running with Nodemon, and all the output redirected to a file. nodemon example.app > 123.log When I change any file in the node app, the NodeJS process is ...
0
votes
1answer
16 views

How to catch system events when a program is being updated and robotize routine steps when you update software?

I'm a support engineer for an accounting program. The program runs under Windows. I have to update many of this accounting software bases daily. I mean the software is always the same. But users may ...
0
votes
1answer
112 views

Why is execution of batch files different between drag & drop and from command line?

Ok, so I've been trying to figure this out for hours with no progress. I have created a batch file to get details of a VHD. Everything runs fine and produces the expected results when run from the ...
1
vote
1answer
89 views

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

Batch file output issue

I am trying to get a batch file to output some data to a CSV file. The command I have works perfectly in the command line but not when I copy it to a batch file. In the batch file, it just hangs and ...
-1
votes
2answers
82 views

Desktop backups maintenance on a network share

I have configured Windows Backup and Restore function on Windows 7 Professional desktops to make daily backup on a network share placed on a Windows Server 2012. (BTW It's a pity that this utility ...
1
vote
4answers
136 views

Prevent Accidental Execution of Windows .BAT File on Workstation?

I have a .BAT file with a robocopy line in it. The .BAT file resides on a network server directory. I use a client/monitor application on my workstation to send out a run command to several headless ...
0
votes
1answer
98 views

Batch script - How to release a locked file for batch 'copy'

A daily windows scheduled task triggers a batch script which moves program files to a folder on a server, using a simple copy routine. rem deploy programfiles copy dailybuild\*.dll ...
0
votes
1answer
141 views

Port IE Bookmarks to Chrome [closed]

I want to be able to automate the transfer of existing Internet Explorer bookmarks to Google Chrome. We're rolling out Chrome to several users, but we want them to have their old bookmarks from IE ...
0
votes
2answers
48 views

assign batch jobs with one processor for each

I have four bat files and a four core machine. Is it possible to assign each run to each core i.e. 1 job for 1 core. Is there any way to control this with commands?
-2
votes
1answer
477 views

Script to copy down portions of a roaming profile [closed]

I'm currently working on migrating users to Windows 7 from XP. We use roaming profiles. Xp creates a folder named "Profile", while Windows creates "Profile.V2". Theses folders are independent of each ...
0
votes
1answer
999 views

How to escalate to administrative token in Windows 7 using only CMD.exe [duplicate]

If I am not able to right click on CMD and run as administrator, or CTRL + Shift + Enter to run CMD, but I am using an administrative user account in a non-admin shell (CMD.exe); How in the world do I ...
0
votes
1answer
279 views

Running scheduled task in current profile with another user

I have a doubt about Windows scheduler: I created a domain user (backupuser) appositely to launch a batch file that starts the backup. The problem is that the batch is launched in the "backupuser" ...
0
votes
0answers
45 views

Display only the last line of a windows command line executable

I'm trying to write a batch script that manages simple software deployments. One of the steps in the script compresses a file structure into a 7zip archive. During the compression process, the z7ip ...
0
votes
1answer
112 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
606 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 ...
0
votes
1answer
156 views

Clearing temp files - Batch file pattern matching for *.tmp also includes *.tmpll

A file match for *.tmp also returns various *.tmpll files, is there anyway to restrict it to *.tmp files only? dir C:\*.tmp /s Also lists a load of *.tmpll files as well. Reason for doing this is ...
1
vote
2answers
744 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
174 views

Robocopy Copy “For Loop”

I'm trying to create a simple script that will robocopy several folders using the command below. When one folder is done copying, it moves on to the next. Does anyone have a batch/powershell for loop ...
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 ...
0
votes
1answer
1k views

Joining an Active Directory domain using netdom

I have a simple script to join an AD domain and rename the computer. When I execute these commands directly on the CLI, it works fine. When I execute the same via batch file, I get an error saying ...
2
votes
2answers
1k views

Batch rename removing second letter in filename

I have about 300 .pst files that I have exported from Exchange 2010. Eventually, I'm going to import them into another Exchange/AD environment. In the original environment, the user names are as ...
3
votes
2answers
519 views

Windows Batch folder size

I need a command (like "dir") that lists all directories with their size. I need just a 1 level deepness but with the total size of a directory. For example >dirsize c:/mainfolder subfolder1 ...
26
votes
2answers
45k 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?
1
vote
1answer
164 views

Is it safe to write batch files with Unix line endings?

I think I ran across a bug in a batch file because it was written with unix line endings. Is this a known problem with cmd.exe running batch files in windows?
5
votes
3answers
510 views

Backup with Mercurial and Robocopy?

The Problem We would like to backup our critical files from several network shares to a removable hard drive. We want to automate the backup so we don't have to remember to run it. It needs to ...
2
votes
3answers
659 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
192 views

Batch file to check version on mass computers

Please help me to create a batch file to run the below command (multiple computers) and the result to a text file. dtcheck "computername" /cmd="version"
0
votes
1answer
112 views

How to know drive letter from a batch file is launched?

I would like to create a DOS/Windows batch file that copy files from a source to the letter drive from which this batch is launched. So, if i run the batch file from G:\ i would like it copy from the ...
2
votes
1answer
146 views

Running a batch script as network services on windows

On linux I know you can run files under different users pretty easily but on Windows how do you do it? Do I have to log in under that user? Can I run it with the schedule system? I need to be able to ...
0
votes
1answer
434 views

Amazon S3 - Automated Backup Using S3Sync, Windows Schedule & BAT file

I am trying to build an automated background backup program to backup my entire website and its heavy photo folders, using Amazon's cloud storage service, S3. I am using S3Sync from S3Tools and have ...
1
vote
1answer
850 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 ...
1
vote
1answer
369 views

Scheduled service/script/batch file to move files on condition of other files with similar filenames in same directory on windows

On Windows Server (Data Center? 2008?), i'm trying to set up a scheduled task that will: Within a particular directory For every file in it If there exists (in the same directory) 2 files with ...
2
votes
1answer
459 views

Pass PIDs from tasklist and kill processes with tasklist

This relates to my thread Pass the PID from tasklist into taskkill to kill a process by the .dlls it's holding open. I am trying to do something like what was discussed in that thread: FOR /F ...
1
vote
2answers
150 views

How to enable logs for execution of multiple URLs through cscript.exe & *.vbs bat file

I have multiple URLs to execute. I am currently using below method I am creatving a vbs file with below content Option Explicit Dim objIEA Set objIEA = CreateObject("InternetExplorer.Application") ...
0
votes
1answer
356 views

mkisofs - Floppy Image to Disk Image

I'm trying to compile MikeOS on windows. I've successfully (I think) created a floppy (.flp) image of the operating system. I want to convert it to a disk image (.iso) so I can run it in virtual box. ...
2
votes
3answers
376 views

I need to clear out the same directory on multiple servers across a network. How do I do this?

On multiple (about 20) servers, there exists the same directory C:\Deployments. This directory has multiple subfolders which contain more subfolders and files. The C:\Deployments directory itself ...
0
votes
3answers
3k views

how to get default gateway of certain adapter in windows bat?

Please see below ipconfig output in windows. C:>ipconfig Windows IP Configuration Ethernet adapter Local Area Connection 11: Connection-specific DNS Suffix . : Link-local IPv6 Address . ...
2
votes
1answer
323 views

batch file to dump data from database and dynamically name the file name

I have a batch process that dumps data from my database (windows 2008 r2) and I'd like to dynamically name my file with the day of the week included. is that possible to do with a simple .bat file? ...
4
votes
1answer
4k views

How to delete scheduled task from command line without confirmation? (schtasks delete)

I can create a task from command line like this: schtasks /create /tn SomeTask /tr "do.bat arg1 arg2" /sc ONCE /st 00:00:00 /sd 01/01/1991 and now I need to delete it. However the command needs to ...
0
votes
2answers
3k views

Batch file for checking port status of multiple IP Address

How to check the port status of multiple IP Addresses from windows command prompt. I am looking for some Batch file or a Dos SCRIPT. Can anyone help on this?
2
votes
2answers
273 views

Windows batch file executes some commands that return output over and over

I tried to put commands that return output into batch file. When I run the batch file it executes the command over and over until I cancel with CTRL+C. I observed this behavior in Windows CE, Windows ...
0
votes
4answers
1k views

Batch file that spawns multiple Cmd prompt sessions running different applications

I am using a batch file to launch two different applications at the same time in different command line windows. Here is what I have: start cmd /k cd Windows\System32\ diskpart.exe >NUL & ...
1
vote
2answers
3k views

mysqlcheck doesn't support multiple contradicting commands

Any idea why I am seeing this error message? This script works fine on a ever so slightly older version of MySQL running on a different server with a similar config. :: check/analyze/repair/optimize ...
0
votes
1answer
772 views

slmgr.vbs supress dialog

We use a batch file with the following content to activate our windows domain computer after imaging: slmgr.vbs -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX slmgr -ato This works well, but there is a ...
2
votes
3answers
8k views

Batch script to download many files via http?

I have a list of urls (over 100) of patch files from various sources that I need to download. I need to create a batch script that will download these files and dump them all into the same ...
0
votes
2answers
385 views

batch file to strip numbers from filename and pad to two digits

I have a text file with a list of server names (servers.txt) that looks something like this: server1 server2 server3 I have a feeling this can be done with the FOR command as I use that to perform ...
2
votes
3answers
2k views

keep command window open after running bat file

i have a bat file that has the following it: sm start "Schedule" this code runs but the command window closes immediately what can i put inside the bat file to keep the window open?
1
vote
2answers
73 views

Batch file problems

I have created a batch file to copy and zip up an entire drive of data on my server. I have selected the D:\ drive to be copied and zipped. However, I have one problem. When I run the batch file, only ...
0
votes
2answers
1k views

Access a Network drive from another user from CMD (windows)

I have written PostgreSQL backups scripts that backup all the databases to file. pgAgent.exe (a scheduling daemon) starts the BAT scripts under the local postgres user. The normal setup is to backup ...