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

learn more… | top users | synonyms (1)

2
votes
3answers
2k views

In windows xp, how can I set the default browser from chrome to IE via Command Line, without admin privs

Situation: 1. Need to Set the defualt browser to IE via cmd(problem) 2. Need to do a citrix login via IE(amounts to loading a url) beause it wont run in google chrome 3. then set default ...
0
votes
2answers
2k 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 ...
-2
votes
1answer
28 views

Loop Counter not working

@echo off setlocal enableextensions enabledelayedexpansion set /a eng_aud_count=0 set /a eng_sub_count=0 For /f "tokens=1-9 usebackq delims=.:^)^( skip=2" %%A in ("MY text File") do ( set trck=%%B ...
0
votes
1answer
2k views

Override mapped drive name using .bat script?

I have the following batch script which is successfully mapping a few of our drives for our users: @echo off net use * /delete /yes net use x: \\192.168.1.52\xrays net use s: \\192.168.1.52\common ...
1
vote
0answers
12 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 ...
0
votes
1answer
9 views

Winzip without command line addon

I'm trying to untar a file and the software installed on the computer is Winzip, but I've been told that the command line addon isn't compatible with Windows Server 2003, so it isn't installed on it. ...
1
vote
0answers
34 views

CMD install based on OS type and architecture [closed]

I am looking for a way to do a CMD install based on OS type (XP, Vista, 7, 8) and architecture (x86 or x64). So for an example if the script detects the OS is Windows 7 x86 (regardless of ...
0
votes
0answers
19 views

Move files into specific folder in a folder directory if empty [on hold]

Batch file that can Move files (Files are all in a folder) into specific folder in a folder directory if empty. I want to make a batch file that can move files into a specific folder/directory if ...
0
votes
2answers
43 views

Batch file rename with random alphanumeric

I am looking to rename a bunch of images (all with .jpg extention) with random alphanumeric names. Example would be 08kDRH1s.jpg or 0FwzUc3.jpg. Doing some searching I did find a few batch scripts ...
1
vote
1answer
2k 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 ...
0
votes
3answers
608 views

How to set the arithmetic precision in “set” batch files variables?

How do I set a precision to the SET arithmetic operation on divisions? eg. SET /A t=3/4 But that gives result as '0' and not '0.75' ( I want at least 2 decimal places ) Or is there any other ...
0
votes
3answers
2k views

run 'net user' command as administrator

I was writing a simple batch file with the following command net user Abhi * where Abhi is my username and I am the administrator of my computer. On execution, it prompts for a password and then ...
2
votes
4answers
47 views

Batch file. Variable in variable

How to use variables in variables? This code: set newvar=%var%var2%% doesn't work. So, what to do? I can't write my program without it.
0
votes
1answer
42 views

Simple batch file fails on Windows Server 2012

On a Windows 2012 Server, from a logged-in Administrator (local and domain), created a batch file "test.bat" by redirecting console input into a file: echo Hello When run from PowerShell cmd prompt ...
0
votes
1answer
221 views

windows script to copy text from one file into a new file

I am noob at coding! I am trying to create a windows script that I can copy text from one file into another. My main goal is to find lines in the text with "started processing" and "file". I am hoping ...
0
votes
0answers
13 views

Batch-file pseudo random

Is there a way to do pseudo-random in batch? Simple random is very bad for my program. It's better to looks like: call:random var 1 100
13
votes
4answers
24k views

Remove USB device from command line

I'm constructing a backup script for Windows 7, and the last action I want it to perform is to safely "remove" the USB drive that it is backing up to. I am under the impression that plugging the drive ...
0
votes
1answer
35 views

Batch file. If statements in if statements

I am trying to write this code: If %dropmode%==on ( If %drop% LEQ %potiondrop% ( set /a potion=%potion%+1 ) If %drop2% LEQ %potiondrop% ( set /a potion=%potion%+1 ) ) So, condition "if %drop2% LEQ ...
0
votes
0answers
16 views

assign drive letter via batch fil based on label

I need a script which would change the drive letter to e.g. P:\ of an USB drive named e.g. "MY_VOLUME". I know this is somehow possible with diskpart /s script.txt > output.txt (using: "list volume" ...
0
votes
0answers
24 views

Using a .bat file to pull a string from a text file within a zip folder

So, please bear with me. This is only the second batch file I've ever written and my first post anywhere on StackExchange. I'm writing a batch file that tells a remote server to run HP Array ...
1
vote
1answer
25 views

Windows 7 batch file to read filenames from a text file and create the file

I have a text file which will have one filename per line. I want to run a batch file that will; - read a line - test to see if the file exists in the current directory - if not, create the named file ...
0
votes
3answers
2k views

run a windows bat file on startup

I have a server access where I want to run some bat files in startup that can run automatically for any user. The problem is Other users are unable to run this file and it is required to be run as ...
0
votes
1answer
27 views

.bat file to create a Library with icon in Windows 7 and 8

Is it possible to create a .bat file that creates a Library with an icon in Windows 7 and 8. Of course this can be done by following the already created tutorials online like Change Your Windows 7 ...
0
votes
1answer
109 views

Is Clonezilla a good option for a daily batch-file-based backup of a Windows XP PC?

Having just been through the process of rebuilding a Windows XP desktop machine when the disk died, I'm anxious to make it a lot less painful. I didn't lose any data, but reinstalling everything took ...
1
vote
2answers
4k views

Batch file with commands to run as administrator and standard user

I'm trying writing a batch file that needs to run some commands using a local admin account (start/stop a service) and some commands using the logged in user (copy files from the user directory) and ...
0
votes
0answers
2 views

Stuck in infinite loop after executing oracle export in java? [migrated]

I have been searching through net, how to make proper export using exec in java. Here is the code I am use for that: private static void execute(String string) { // TODO Auto-generated method ...
-1
votes
1answer
31 views

I still use MS DOS style batch files (.bat) What should i be using these days, instead? [closed]

Surely there better substitutes out there for this kind of simple scripting on windows? I've tried googling but just get stuff about editing old batch files.
1
vote
1answer
24 views

batch script to swap words / rename files

could someone help me please? I have win xp and bunch of e-books named like this: Title - Name Surname.mobi and I need a BAT file to get: Surname Name - Title.mobi I am almost able to swap what´s ...
1
vote
3answers
988 views

How can I create a popup in Windows with the results of a command called in a .bat file?

I'm calling an exe in a .bat file that returns quickly and I'd like to popup a message box with the results of the text so I can read it (after the program has ended). My .bat looks like this: ...
-1
votes
1answer
40 views

What comand do I enter into my batch file to do this?

I want my batch file to find a string in a file and return it to the next line in my batch file. How can I do this? I've googled over and over but can't get the specific answer I need with the ...
2
votes
7answers
5k views

Why do I have to import .reg file from RegEdit in Win7 and not from .bat file?

I have a .bat file that makes a call to a .reg file (something like: regedit mytest.reg). I run the .bat file as administrator but I get an error: "Cannot import mytest.reg: Error opening the file. ...
0
votes
0answers
22 views

Prevent Firefox's “Well this is embarrassing” screen from appearing at first login only

My parents have Windows 7, Firefox 30 and two user accounts which they regularly flip between and then shutdown the computer. As a result the "well this is embarrassing" page appears frequently when ...
0
votes
2answers
78 views

How do I concatenate files using a list and batch?

I need the equivalent of the shell command xargs < list.txt cat -- > compiled.txt as a Windows batch file. There is a directory full of text files (about 50 to 500 files) that I need to ...
0
votes
1answer
45 views

how to batch change date created to date modified

I have many video files ending with extensions mov, avi, mp4, and mts. I need to change their "date created" to their "date modified value" I tried using the following powerhsell script: ...
0
votes
2answers
596 views

WinXP SP3: run batch file when system returns from hibernation

I want to run a *.bat file every time system returns/"wakes up" from hibernation (NOT a sleep mode). How can I do that? System: Win XP SP3. I would very strongly prefer to solve it without using 3rd ...
2
votes
2answers
53 views

Start program, wait until it outputs certain string, then continue

I want my batch script to run a batch script, which doesn't terminate, then run several more batch scripts, which do terminate, and then close the first batch script. The issue is, the first batch ...
0
votes
1answer
25 views

Get size of a file and save it to a variable in Windows console?

I'm making a windows batch script, I need to get the specific size of a file so I can Insert that and other values I already got to a database, but I just can't figure out the proper way to do it. ...
0
votes
2answers
50 views

Automatically reboot Windows8 if no internet activity

I have a media server located in a very inconvenient part of my house. Occasionally I will have to reset my router or it will reset itself. The issue is the PC loses connectivity for some reason, and ...
1
vote
3answers
4k views

Change directory in batch file with PowerShell

I need to changed directory using batch file in PowerShell. Let's say the batch file named go.bat has the two lines of code. And I'm in q: directory. c: cd c:\abc\def When I run go.bat, I'm ...
0
votes
0answers
15 views

How to save a document and close it after the save

Currently I have a .bat file that opens a program, opens a document and then reloads this document so it contains new data. After that I need a timeout so it can run some other things within the ...
0
votes
1answer
75 views

7z in batch file with variables “Incorrect command line”

I'm trying to run the following batch file: set HH=%time:~0,2% set HH=%HH: =0% IF %time:~0,2% GTR 5 ( IF %time:~0,2% LSS 21 ( FOR /F "TOKENS=1 DELIMS=:" %%A IN ('TIME/T') DO SET HH=%%A XCOPY ...
0
votes
1answer
91 views

How to automatically enter username and password for network location in batch file?

I have a batch file that copies files to a network location on WebDAV. The address looks something like this: \\xxxxxxxxx.net@SSL@2078\DavWWWRoot When I restart my computer, the batch file doesn't ...
1
vote
0answers
32 views

How to open a webpage if it isn't already open, and if it is, switch to it instead?

I am currently executing this command in my batch file "C:\Program Files (x86)\Internet Explorer\iexplore.exe" "http://localhost" to open up my page in Internet Explorer after generating it and ...
1
vote
0answers
34 views

Windows / Create txt files of subfolders with file names in it

I have a folder on my HDD that contains like 1000 or so subfolders. These subfolders contain files and sometimes more subfolders. Now what I want to have is a script that creates a .txt file for each ...
-1
votes
1answer
19 views

Is there a way to read a simple one line asp page using a batch file?

I have a simple asp page in which i write an ip address, and nothing more. Now i need a batch file to read the contents of this page and pass it to a variable. I'm not good with batch files but ...
-1
votes
0answers
22 views

How to load a URL only if it exists in a batch file using curl for windows?

I am trying to shutdown a service running running locally by using URL like 'localhost:3502/shutdown' using curl. I give curl 'localhost:3502/shutdown'. But I need to do this only if the service is ...
1
vote
0answers
68 views

Running Batch file from servers network share - using servers local user account

I am trying to create a script that could be run from servers network share and promt me to type servers local username and password as credentials. So, .bat file is located at ...
0
votes
1answer
53 views

xcopy command does not work in a batch file

The command below works in CMD Prompt, but does not work in a batch file. xcopy "D:\Desenvolvimento\Repositórios GIT\driverXD\app\*" driverxd\ /e
1
vote
5answers
4k views

How do I exclude specific directories from a Windows search?

I want to search for a file on drive C:. I know for sure it does not exist in a specific directory(s) (say Program Files). So to shorten my search time, I want Windows to exclude searching in those ...
1
vote
1answer
59 views

Is there a script "to log remote users off and after log them off to delete their profiles?

I found 6 simple scripts (.bat and .vbs) for remote pcs (Win XP and 7) to Clean Profile properly and faultlessly: Script: sending Ping to check Remote PC On or Off (.bat) Script: checking who logged ...