Text file containing a sequence of commands or program invocations.

learn more… | top users | synonyms (1)

4
votes
1answer
58 views

Why is the “set /p”-method used in a batch script to read the first line of a text file not working in the body of a “for”-loop?

I tried to apply the answer given by Spaceballs to this question within the body of a for-loop. example.bat: @echo off copy NUL %1 echo firstLine >> %1 echo /=======================/ for /l %...
0
votes
1answer
73 views

Batch convert flv to mkv with mkvmerge

I have a bunch of *.flv videos in a folder on my Windows computer that I would like to convert (or remux) to *.mkv. Since I have a lot of files I would like to automate this process with a batch ...
3
votes
1answer
70 views

Drive letter of given file in windows batch

I'm writing a script where I will get a file name as a parameter. The file will be absolute. (Ideally the solution would support relative files as well, but I can live with absolute-only). It is ...
0
votes
4answers
196 views

Executing a powershell script through batch file

I am trying to execute a powershell script through a batch file, at the moment I am only testing this to get it running so the .ps1 file is simply a hello world script. This ALMOST works fine except ...
0
votes
0answers
21 views

How to create new folder based on the copied text

it's my first question here on the website. i'm asking about create new folder based on the current copied text. in my work, i'm creating like 100 folder per hour for each file, and each folder must ...
1
vote
1answer
883 views

Commandline tool to set msspecific “rating” tag in jpeg

I want to create a windows batchfile to set tags of jpeg-files to the contents of a database. i am using ExifTool-6.93 for this. this works perfect setting "keywords". Unfortunatly exiftool cannot ...
0
votes
0answers
7 views

iMac 10.9.5 directory file names

I have a directory which contains files and folders. The folders contain a single pdf file. Each pdf file is named according to the following convention: DDDDD-LLL-LLLL-L-DDD - [random phrase of ...
0
votes
1answer
25 views

How to escape quotes in arg passed to program

So I have following problem. I have batch script script.bat having folowing content cat %* | gawk " { value = "something" } " Which obviously does not work. In bash, I would escape the quotes ...
5
votes
2answers
5k views

How to run a windows .bat script with wine from command line?

I'm trying to run a batch script from my mac terminal using wine (in order to provide arguments to a windows executable and piping output). so far I've tried executing wine runme.bat but ...
0
votes
0answers
33 views

Batch - Schtasks Onstart Repeat Interval

Command I'm using: SCHTASKS /Create /SC ONSTART /TN "TaskName" /TR "path" /RU "user" /RP "pass" /RL HIGHEST I'd like to repeat this task every 10 minutes, which would be doable with the /RI flag, ...
0
votes
1answer
26 views

Marking / flagging files in a way that is visible to a windows batch file

I would like to construct an automated procedure for transferring files from my Windows desktop to a remote storage for backup. I envisage the automation being done by a Windows batch file. To ...
0
votes
1answer
27 views

Using WIndows 7 SR1

I work in a company that does net support for 20 different schools. While working on accounts I might log my "test" computer in 10 different domains in one day. After a few days a login goes from ...
1
vote
1answer
45 views

Disable/enable lan-device by batchfile: If comparisons not working

I have created this .bat-file which is invoked by clicking on the proper shortcut, which is configured properly. But the last two comparisons seem not to evaluate properly. Here we go. @ECHO off ...
5
votes
3answers
2k views

Why does “start winword” work but just “winword” doesn't?

Assume Microsoft Office is installed. Consider the following batch file: REM the following line successfully launches Microsoft Word start winword REM none of the following commands work to launch ...
1
vote
1answer
188 views

Create Bat File With Excel Data with VBA

I took some research from google Sub ExportRangetoFile() Dim wb As Workbook Dim saveFile As String Dim WorkRng As Range Set WorkRng = Sheets("Match").Range("K:K") Application....
1
vote
1answer
217 views

Script - Lenovo Battery Recall

Problem: LenovoBattery.exe fails when called via batch file. Is there a way to make it work? Details: Lenovo has expanded its voluntary recall of notebook batteries. They request the industry to run ...
1
vote
0answers
79 views

MSInfo32 command line switches and Windows 10 issue checking remote PC

I am trying to run MSInfo32 on a list of hostnames using the command line switches: for /F "tokens=*" %%A in (hosts.txt) do ( start /wait msinfo32 /nfo %%A /computer %%A ) It appears to work ...
0
votes
3answers
13k views

Batch IF .exe is not running

I am trying to create a batch that IF program.exe is not running in process, it will run code below. In vb.net this is easy, but I do not want to create a program. I am guessing a VBS script would ...
3
votes
2answers
86 views

How to execute a program using wildcards in the path

I try to launch an .exe file in a very simple batch script. The problem I'm faced in is that I don't know the name of the target folder where the program is located cause it's suffixed by the ...
0
votes
0answers
37 views

How to run a task when a event is registered? (Windows XP)

Perhaps my question has already been answered, but I need my script run after Windows register any WiFi connection event. (The bat script reconnect a mapped drive only after there is a wifi connection)...
4
votes
1answer
73 views

How do I escape a certain character in a variable in a batch file

I made this script but it doesn't work : for /R %%f in (*.mkv) do ( ffmpeg -i "%%f" -vf subtitles="%%~nf.mkv" -acodec copy "%%~nf.mp4" ) PAUSE After looking for the problem, I found that the ...
0
votes
1answer
150 views

Is there any way to add an HTTP Header to every IE request on a computer?

I would like to add a custom HTTP Header to every Internet Explorer request on a computer (or every browser request). I don't know if this is possible whatsoever, if you have heard of anyway to ...
2
votes
1answer
53 views

How to quickly copy *specific multiple* files?

Say I have a list of filenames like these, file01.001 file02.abc fiAl.12x ect. All with full extensions. They are all in the main folder C:\ABC. Some files will be in subfolders or even in ...
1
vote
0answers
44 views

Notepad++ custom language how to only highlight if comment keyword has a space

In the custom language editor in Notepad++, I recreated the batch language syntax highlighting, as I saw it as poorly made. My issue is that in making a remark with rem, I cannot have words like ...
1
vote
1answer
80 views

How to set one password for all net users in cmd for batch script?

Im writing a windows batch script and I need to set all the users to a certain password? I know that I can do net user to see all users on the computer and I can do net user username password to set ...
2
votes
0answers
31 views

Can I prevent the change of overlay icons?

Background Several programs modifiy the icons in explorere to indicate a state ("synched" etc.) It is a known fact, that Windows (win7, win8, win10?) can only handle a limited amount of such icons ...
3
votes
3answers
2k views

Windows 8.1: Restore .bat file association to default

A few weeks ago I accidentally changed .bat files to open with Notepad++ (a fairly common issue I believe). On Win XP and Win 7 I had a .reg file that updated the relevant registry keys and sorted out ...
0
votes
1answer
154 views

A task inside my windows task scheduler will cause my server to stop responding

I have the following AppPoolActivation.ps1 file, to call a URL :- [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} $request = [System.Net.WebRequest]::Create("https://...
1
vote
4answers
172 views

Batch file to run programs as admin - error 740

I am working on a small batch script that elevates basic windows programs to run as administrator. All of the functions work fine but I have ran into a problem when trying to run "regedit.exe". When ...
0
votes
2answers
99 views

save username and password in batch file to log into putty is recommended?

Is it safe and secure to save username and password in a batch file and use it to connect to putty ? Batch file contains below command: start putty -ssh -load session -l username -pw password
0
votes
1answer
80 views

Command line (Windows) to update same xml file with trim

Currently I am using a curl command to grab data output to a text file and trim top 14 line away, convert the file to abc.xml @echo off call :sub >output.txt exit /b :sub c:\curl -X GET ...
0
votes
1answer
37 views

Rename folder on remote server

I am calling a .bat file which contains the following command net use \\128.545.k.k\E_Drive /user:Username psw to connect to a remote server. I would like to rename a folder on the remote server i ...
1
vote
1answer
139 views

Local group policy for all users

Windows 7, 64bit. I have two simple .bat scripts created, one which runs at logon, the other at logoff. The .bat files are located in C:\bat. Other users have access to this folder. The contents of ...
1
vote
1answer
57 views

Disable com port until login

Using Windows 7 (64bit). I have an RFID Pad connected to my PC via USB. My issue is that whenever the RFID pad is connected and I start the PC, I get a blue screen of death just after the 'Starting ...
3
votes
3answers
296 views

Batch command how to make a list for set /p

I am trying to make a batch script that asks for user input. The user input should be limited to certain words. If the user enters any other words than e.g. (eng, ger, fra) the user will get an echo ...
0
votes
2answers
67 views

RDP logout using bat file

Using Windows 7. When I RDP to a PC I'd like to be able to logout of the session without the screen reverting to a Ctrl+Alt+Del Login screen. The PC's in question are kiosks running Chrome in full ...
0
votes
1answer
72 views

Using for and if commands for a list of strings in a batch file

I am making a batch file for windows. I have just started learning batch scripting and I have some problems here. @echo off set langList=("eng","fre","chi") :Get_ISOlanguage set "ISOlanguage=" set /...
0
votes
1answer
28 views

Run several processes in cmd window with ConEmu

I'm using ConEmu with Windows 8.1. I need to write a BAT-file, which will run ConEmu and open several cmd-shell tabs, running a process in each of it. Right now my file looks like this: start "...
0
votes
2answers
43 views

Copying and renaming of .xlsm files using batch

Its glad to be here and i am really excited n new to batch scripting. I have been using a batch containing below for copying an excel from one folder to another { @echo off cp -r \\Folder1\...
3
votes
2answers
213 views

How can I tell if my batch file is running?

I have a batch script which is run from an AT command, and may get run more than once. When it starts, I need it to detect if it already running, and if so, exit (the second one) immediately. It ...
1
vote
1answer
199 views

can you start a program at windows startup using bat file and send it file path

can a bat file or vbs file take an argument (a path to an exe file) then create a shortcut to that file and place in the startup folder or add a registry entry to run that exe at windows startup but ...
0
votes
1answer
783 views

Windows batch file not running when I double click, how to restore association with cmd.exe?

Windows 8 64-bit. The user I'm logged in as has admin rights. When I open a cmd windows the window title even says "Administrator: cmd.exe". So, I set my .bat file association to have the .bat file ...
-4
votes
2answers
396 views

windows 7 batch file for swapping filenames randomly

I need to write a batch file that goes into a folder and randomly swaps (renames) all the filenames. This folder has about 1000 files. So it is acceptable if there are few misses.
1
vote
1answer
79 views

Run Atom using a bat file after changing directory

I have writen in my bat file cmd /k cd /d"C:\Users\amanz\Desktop\Introduction - Computing\Java files" call atomer.bat right now, it just seems to change the directory and stops right there. It ...
2
votes
1answer
115 views

Batch command delete from list of files from multiple computers

Currently I use a poor piece of programming where I delete multiple files on multiple PC's. What I would like to do is have a file with the names of the PC's (PC.txt) and a file (filedel.txt) with ...
0
votes
1answer
25 views

Open an executable with a parameter?

I'm trying to open putty with my server data loaded through a batch file. I tried start "OVH" "C:\Program Files (x86)\PuTTY\putty.exe -ssh username@ip.address -pw password", and that did not work; ...
0
votes
1answer
27 views

Batch file to detect when a device connects to hosted wireless hotspot on a laptop

I have created a wireless hotspot on my laptop using: netsh wlan start hostednetwork This works perfectly. I have a raspberry pi that automatically connects to this network automatically, however ...
3
votes
1answer
243 views

Batch file FOR loop to copy folders only if they exist in another folder

I'm trying to write a batch file that copies folders from one folder location to another, but only if they exist in a third folder. That sounds confusing, I'll try again. I have the following 3 ...
1
vote
1answer
93 views

Bat file doesn't log when running from task scheduler?

I made a bat file which restarts 2 services, and I have it run in task scheduler. If I run the bat file normally, I can see it logging in current directory as the bat file. But if I run it through ...
1
vote
1answer
51 views

Need assistance with an existing batch file

I need a batch file that I can leave running, and if "Unturned.exe" is not running do START "" /B "C:\Users\Administrator\Desktop\1.lnk", and then idle, scan, and wait for it to shutdown again in a ...