Text file containing a sequence of commands or program invocations that does not need user intervention.

learn more… | top users | synonyms (1)

0
votes
1answer
10 views

Parameters with spacebars parsed incorrectly for a powershell script run from a batch file

I have a batch file that runs a powershell script and I need to pass two parameters to the script. In my batch it looks like this: powershell -executionpolicy remotesigned -File "my script.ps1" "my ...
1
vote
1answer
10k views

Run a batch file on a remote computer as administrator

I am trying to run a batch file (to install some software) on a remote computer. To do this, I am using PSExec. psexec.exe \\COMPUTER C:\swsetup\install.bat This works fine, apart from some of ...
-2
votes
0answers
27 views

I Need BAT file to perform actions, and also write echos and actions to a log file [on hold]

I Need BAT file to perform actions, and also write echos and actions to a log file... In other words: Whatever is "written in the BAT file", should be sent to the log file, as well as the actions ...
0
votes
2answers
13k views

How can I refresh my PATH variable from the registry, without a reboot, logoff, or restarting explorer?

I've made some changes to the %PATH% variable in the registry. Now, I'd like to see those changes applied without having to go so far as a logoff, reboot, or reload of Explorer. Is there a way this ...
0
votes
1answer
35 views

Batchfile will not exit after running (when more than one spawned)

This batchfile (any all others) will not exit after running when more than one are spawned. I am an experienced MS-DOS/Windows/Java developer and I have never seen this behavior before. Something ...
0
votes
1answer
13 views

Script to access same path on different devices

Is there a way to make a batch file that access same place on a different workstation? Example path: \\station1\c$\windows\system32\spool\printers When running the script I want to be prompted which ...
0
votes
1answer
14 views

Program counting minutes from start to stop. and generates txt report.

I have created a batch file based application that installs a number of things on the machine . I would like in this context is a program that I eg can run via batch file example : "start count time " ...
0
votes
1answer
78 views

Batch File:List all files of a type, rename files, flatten the directory

I am looking for help with a batch file(s) that will allow me to move all files of a particular type (*.PDF's for example) to a new folder. HOWEVER I would like to have features not readily apparent ...
1
vote
4answers
12k views

How to automatically make my PC sleep and wake up?

I have a laptop back home with Windows Vista installed. I want my computer to fall asleep automatically at 01:30 AM and wake up at 06:30 AM. I have tried a lot, but making a .bat file which makes it ...
0
votes
1answer
33 views

Can I launch a URL in browser, from scheduler, unless the URL is already open in a tab in the default browser

I'm using the task scheduler in Windows to launch a page in the default browser at a particular time each day. The problem I have is that if the page is already open in the browser, it will open that ...
-1
votes
3answers
710 views

How to run a .bat file silently and automatically

How am I going to run a .bat file in background? And is there any possible way wherein every time I'm going to turn on my computer everyday the .bat file will automatically run and execute.I don't ...
-2
votes
0answers
22 views

I need a batch file to copy a template folder and rename next in sequence

We have folders for each new assignment that comes in to our office, eg. 15-P0001, 15-P0002, etc. There are multiple folders within each assignment folder. We have a template folder named 15-P0000 ...
0
votes
0answers
22 views

Command works in C:\ But not in Users

I am working on a backup program before we image users computers and I want to search for certain types of files. for /r /d %a in (*) do @copy "%a\*.png" "%usr%\file\pic" < All It works great ...
-3
votes
2answers
31 views

Create windows script to traverse all subfolders of some folder, and delete a certain folder and all of it's contents if it exists [closed]

here's the trick. Supposing I want to free up some space, and run that script in F:\UnrealProjects, which has a bit over 50-60 subfolders, I would like that script to traverse all of it's subfolders, ...
0
votes
2answers
36 views

Find group of words in a text file and extract the line to new text file

my file ref.txt contains word "hi" "hello" "aloha" as per below: hi hello aloha And I have one more file abc.txt which contains many words including the above 3 words. Now I developed a ...
0
votes
2answers
30 views

Log date and external ip address with curl and batch (Windows)

I am having weird issues where my external IP is changed VERY often as in every 2, 3 minutes. I have a dynamic dns service in place that I update via task scheduler with curl called in a batch file. ...
0
votes
1answer
22 views

.bat that calls AFUDOS to flash BIOS

I've got a .bat file that is supposed to flash the BIOS on my laptop. It reads as follows: @AFUDOS T.105 /p /b /n /e /x /reboot Before actually running it, I would like to unterstand what it does. ...
0
votes
1answer
47 views

How to make batch file to open specific Profiles in Google Chrome

I have .BAT batch files to open a set of programs, web pages and explorer windows. With sufficient Googling I've still come up short as how to execute the profile target "C:\Program Files ...
1
vote
2answers
33 views

How can I force a scheduled .bat job to run in the foreground?

I have a simple .bat that runs a PHP script at the same time every day. @echo ON php C:\path\to\script.php argument pause It runs fine when I double-click the .bat file. And I set up a scheduled ...
0
votes
3answers
39 views

Multiline && combinator operator for command chaining in batch file

I see that this operator is used in windows (and might be Linux?) to chain/combine multiple commands in one line. Commands are executed one after another, as long as preceding complete successfully ...
0
votes
1answer
25 views

Is it possible to substring an environment variable in a windows 7 shortcut? [duplicate]

If I have an environment variable in Windows such as %username% if there any way I can substring that? I'd like to substring it down to the first 8 characters.
0
votes
2answers
29 views

WinSCP script hangs when connecting to host

I've batch script that runs winscp with script, and sometimes WinSCP hangs when is "Connecting to host". Is it possible to set timeout that WinSCP stops trying to connect and shuts it's self after x ...
-1
votes
1answer
29 views

Grab filename for manipulation

Similar to my request here I'm looking for a way to take the name of a numbered file and use it else where in a batch script. For example, in a folder there would be a file named 159 and I would ...
11
votes
6answers
18k views

Delete all files from a folder and its sub folders

I want to remove all files from a folder structure, so I'm left with an empty folder structure. Can this be achieved in either batch or VBScript scripting? I have tried a very basic batch command, ...
2
votes
3answers
3k views

How to set to a variable, the result of a expression

I need to extract the date of a file, for then use this string as part of the name of a new file. I trying to solve this using the next commands: First I get the details of the file and redirect the ...
1
vote
2answers
3k views

Looking to create a batch file capable of editing a line (or word) in a text file

I have a text file (...\config.txt) containing 2 lines which looks like: Preamp: -4 dB Include: surround.txt I need to change "surround" to "headphones" in that config file. I really need to make 2 ...
0
votes
4answers
3k views

Run Windows batch files at startup or when any user logs on

I have a server access where I want some batch files to run automatically for any user at startup. The problem is: Other users are unable to run this file and it is required to be run as the user ...
0
votes
2answers
2k views

Cut a part from a filename (windows batch)

I got files named like this: cam1(word1 word2 wordN) (24-04-2012 00-11-13).mpg cam2(word1 word2 wordN) (24-04-2012 00-11-13).mpg cam3(word1 word2 wordN) (24-04-2012 00-11-13).mpg Need to cut (word1 ...
16
votes
4answers
244k views

How can I check a system's current NTP configuration?

I need to verify the current NTP configuration on some Windows systems. Ideally, I'd like to be able to do this via command line instead of navigating through configuration screens. (I'm working on ...
0
votes
1answer
56 views

Running .bat file in zsh (in Windows)

On a Windows machine I want to avoid using cmd.exe at all cost. I'm trying to use babun (mintty 1.1.3) to run a batch file in a Windows folder. This works: { ~ } » ./file.bat -o /path/to/files.xml ...
1
vote
2answers
3k views

How to input YES in a batch file automatically?

I am uninstalling Citrix client using a batch file. The batch initiates the uninstall successfuly, but I need to input YES (for confirmation) automatically. How can I do this in the batch file?
1
vote
1answer
56 views

How can I get ConEmu to open more than 30 tabs?

I have a .bat file which opens 100+ consoles, but I need them in new tabs. Problem is, ConEmu has a max of 30 tabs. I can do this with regular cmd, but its 100+ new windows. I'd prefer them in tabs ...
0
votes
0answers
19 views

“Password Expired” when attempting to access Win7 machines on local network with our local admin account [migrated]

Looks like all of our Win 7 and Win 8 machines were somehow set to expire the admin account that we created locally a couple months back. Now we're trying to make sure we either have to go to ...
0
votes
0answers
26 views

How to improve a batch file

I wrote the following batch file below in order to clean temp files and clear cache. Problem is that when someone downloads this file he gets a notification that this file may harm his/her computer. ...
1
vote
1answer
4k views

Batch file to install TotalCommander without User intervention

I am new to windows batch file. Here is my first attempt in batch file. Here is my requirement: I should have batch file. When executes, it should read the XML config file for the software list to be ...
2
votes
5answers
3k views

How to automatically move a file to another PC on the network?

Here is what I am after. I have 2 PCs connected on a network and one of them prints out an Excel spreadsheet every night to a specific folder. Is it possible to use a batch script to copy that file ...
0
votes
1answer
38 views

How to run typeperf from batch file?

How to run commands like typeperf "\Process(*)\% Processor Time" -sc 1 from batch file? Ran from command line this command outputs something monstrous, while ran from bat file it prints Error: No ...
2
votes
1answer
7k views

How can I copy a file on a network share using a different login with powershell or batch file?

I have a file in a shared location that I want to copy over to my local hard drive. However I will not be running as a user that has access to the share. So I want to be able to authenticate under a ...
0
votes
1answer
125 views

copying files with certain extension and overwriting

I do this often and I've seen similar questions but not quite the same. I want to copy from z:\foo to c:\bar all .cfm files and overwrite any conflicts. I also want to keep the directory structure ...
3
votes
1answer
3k views

Install a Teamviewer host silently with custom password

Our company has the custom Teamviewer hosts that we can run silently with the /S switch. The issue is that we can't connect due to it not setting a password that we know. Does anyone have any thoughts ...
-1
votes
1answer
31 views

How to delete all files that match a pattern (or older than..) except the newest file that matches the pattern?

I have a scheduled task / script running that takes a snapshot of a file each 3 hours, but the file is growing and disk space is limited, so each week I want to perform a cleanup. As for now I do ...
0
votes
1answer
58 views

Rename files using batch file

I have been searching for a way to rename 150 files daily simply by executing 1 command. The current files are in the same folder C:\reports. The file names differ and the only change I have to make ...
0
votes
1answer
9 views

How to rename multiple vars that contain FOR counter vars in bat file

Here is my sample: set mail = mymail for /L %%x in (001,1,999) do ( set yourmail = !mail:+%x@gmail.com :: other commands here ) I want the result be like: mymail+001@gmail.com ----> ...
0
votes
0answers
27 views

Task Scheduler running a bat file that duplicates screen

When you lock a computer on windows 7 your login screen appears on your main display and then on other monitors it is completely black, when your displays are extended. This problem is fixed when you ...
1
vote
1answer
29 views

Bulk Download Images with Organization

I have a list of URLs (pretty much all image urls though some pdf) that I need downloaded. I have found a variety of options for bulk downloading and these would work but I need them to be organized ...
0
votes
0answers
16 views

Email alerts using Blat command

I tried to use below blat command to configure blat in command prompt for sending email alerts. --blat -install SMPT.XXXXX.com NAG@mail.com -but is is showing below message "Blat is not recognized as ...
0
votes
2answers
19 views

How to restrict changing env variable locally by batch file

I have two batch file x.bat and y.bat. I m calling y.bat from x.bat. File y.bat sets an env variable like: set ABC= Restriction is I cant change this Y.bat file but I want my variable "ABC" to be set ...
0
votes
0answers
33 views

My batch files keep instantly closing, and there is no .bat association under FileExts

I am trying to launch a batch executable, but my PC shows no .bat association in the registry. Recently, I started off by simply modding my Star Wars: Battlefront 2 game. Eventually, it asked me to ...
0
votes
1answer
29 views

How to Access “My Computer” files from Command Prompt

I'm trying to figure out how to access files on "My Computer" from the command prompt. In particular, I want to access files on my phone's share, e.g., My Computer\SAMSUNG\Phone\somefile.txt. That ...
0
votes
2answers
4k views

/ was unexpected at this time

I am getting "/ was unexpected at this time." while using the below for loop for some cases only. for /f "tokens=1,* delims=;" %%m in (file.txt) do ( echo Inside Loop echo %%m ) I'm ...