Text file containing a sequence of commands or program invocations.

learn more… | top users | synonyms (1)

1
vote
0answers
202 views

.bat script doesn't work by using window scheduler

i created a .bat script to perform daily folder compression. it is working fine when i double click the .bat file. However, it doesnt work when i include it in window scheduler. Below is the script: ...
1
vote
2answers
448 views

How can I zero-pad numbers in a Batch FOR loop?

I am writing a batch file to do some operations on remote computers in my building. They are all named with the same prefix, but the number at the end changes (01–65). I tried to follow an online ...
0
votes
0answers
56 views

Batch ren Command - Only Rename Files with This Pattern

There's a program I use that renames some files to a random string on each use. It's annoying, and I can't get it fixed, so I wrote a script to change them back when I'm done using the program. The ...
1
vote
1answer
1k views

Windows XP/7 copy command line involving junction

I have a batch script which needs to work with Windows XP (for the time being) and Windows 7. The script also copies a link to the Windows Desktop. copy /Y path\to\the\link.lnk ...
0
votes
0answers
56 views

How to switch user rights within Batch file (de-elevation after elevation and back)?

I have a batch file that I need to run as Administrator, but within this batch file I need to run some commands as non-administrator, followed again by admin-commands. admin commands user commands ...
0
votes
1answer
75 views

net use maps to wrong user on Windows

I have a Batch script that I need to run with elevated rights (starting Services etc.). This script also does net use g: \\network\path. But because I run the batch file as Administrator the mapped ...
-1
votes
1answer
207 views

How to accept user input command in batch file?

I would like to write a batch file in which the user input would be run as a command, essentially functioning like command prompt. Example: batch file is run: user input: echo hello program output: ...
0
votes
0answers
112 views

RAR/ZIP Extract and Delete in Right Click Menu

In WinRAR, is there a way to use something like 'Extract And Delete Zip File' in context menu? I just need this option, it can be whether a batch file or another program that has this in context menu ...
0
votes
1answer
251 views

Find highest possible screen resolution from command line

With Powershell, I can request the current screen resolution. this is not what I'm trying to do. I'm trying to find the maximum resolution I can set the screen to (slider all up). Is this even ...
1
vote
2answers
686 views

bat file to open up a chrome browser window with no toolbars

How to use a bat file to open up a chrome browser window with no toolbars.(just like a popup window) @echo off start "Chrome" chrome --new-window http://localhost/jayambe/ this code when run opens ...
0
votes
1answer
1k views

Batch file - copy file from parent folder - why the cmd file closed adter the run?

I'm using this code to copy files from the parent folder. But as soon as the code finish the execution, teh CMD window is closed. So I cannot read the result to see what the problem is. Here is my ...
0
votes
2answers
441 views

Print the file name with another extension (Batch-program)

Batch-program launchs with 1 parameter (full path to file) program.cmd "C:\Path\To\File\Filename.txt" Now, this program consists of 1 command: echo %1 And it just prints an argument: ...
3
votes
2answers
2k views

How can I stop percentage expansion in a batch file?

(This is on NT based Windows like 2000, XP, Vista, 7) On the command-line, the percentage characters are ignored: wget ...
3
votes
4answers
7k views

Can I run bat file on 64 bit system?

I have a bat file that I ran successfully on my old Windows Vista 32 bit system. Now that I have upgraded to a 64 bit Windows 7 system, will it be possible to run the same bat file? Is there a ...
3
votes
1answer
1k views

Fire batch (.bat) file execution and continue

I want to write a .bat file that starts executing another few .bat files, without waiting for the 1st to complete before going to the next one. Spawning multiple cmd.exe commands is OK. I tried doing ...
1
vote
2answers
3k views

FTP script won't transfer remote files to local computer

This is a follow up to FTP BAT file - Windows Scheduled Task. I copied the FTP script, but I can't transfer the files to my local computer. All I get is this (server address omitted): 331 ...
1
vote
2answers
5k views

Windows batch command to display all network connections?

What Windows (preferably XP) batch command will list all of the network connections that appear in the Network Connections dialog? I've tried RASDIAL, IPCONFIG, NETSTAT, and NET commands with various ...
0
votes
1answer
61 views

Batch is starting too fast after reboot

So i have batch1 as this REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /V 2 /D "%~d0\bat\batch2.bat /f and then I reboot the computer (Windows 8) and batch2 starts. It seems like ...
1
vote
1answer
43 views

How to have a batch call another batch based on its location?

I have made a file I will put up for download. It involves one batch file calling another. Most of the time this is not a problem, but in my case I have no clue where they will download it. So how ...
0
votes
1answer
98 views

How to unhide a batch file

I am trying to make a .bat script that will unhide another .bat file in the same folder only once. I am making an auto backup for a game, but first I want the user to agree to Terms of Use and ...
2
votes
1answer
1k views

Batch delete temporary Windows files (system, browsers, cache, etc) for all users

Is anyone in this community using a particular technique to achieve batch deletion of temporary data (such as Windows temp folders, browsers cache, etc) for all users? The tricky part seems to be: ...
-1
votes
1answer
43 views

Batch file timer [closed]

I would like to know I there is any way to make a timer in a batch file where you press something and it does something and if you don't it does something else Thanks
0
votes
0answers
19 views

Batch File to Send Zip File to CD/DVD drive [duplicate]

I have written a batch file which creates a Zip from a set of files. This works fine. I would now like to extend this batch file so the outputted zip file (from the above batch file) is written to a ...
0
votes
0answers
26 views

Losing credentials when adding echo off

I needed to map a drive to another domain and it worked perfectly, here is the batch file. net use W: \\com-p55.test.ad.testdom.com\software$ /USER:domain\username password /PERSISTENT:YES The ...
2
votes
1answer
151 views

Reg.exe Offline registry edit

Ok I want to edit an offline registry entry from WinPE, if I am booted into the OS (32bit) the reg key is: hklm\system\currentcontrolset\services\mountmgr\noautomount So I boot into WinPE and run ...
0
votes
1answer
146 views

Special characters in folder names cause delete by batch-file to fail

I'm trying to delete empty folders via a batch file, in Windows. for /f "usebackq delims=" %%d in ("dir V:\Temp /ad/b/s | sort /R") do rd "%%d" fails on folders with special characters - ...
1
vote
0answers
81 views

Unable to send files over 1 MB via FTP on Windows

I tried to send multiple files via FTP commands using simple batch script. It works fine when the file size is less than 1 MB but when the file is larger than 1 MB I get the following error log. ...
1
vote
0answers
49 views

How to save Ping record in every single hour for 2 weeks?

how do I save the record ping "in every single hour" for a certain period, for example for 2 weeks, with the format dd / mm / ss, dd / MM / YYYY and beside it is the result of the ping. So we can ...
0
votes
2answers
75 views

send output of batch file to current directory

I have a .bat script that concats some text files into one big file. I would like to have the resulting file go to the current directory instead of the hardcoded path. Here is my script: @echo off ...
6
votes
3answers
7k views

What does the percent sign (% and %%) in a batch file argument mean?

I think I'm missing something because I can't seem to find what this means. Example: for /D %%A in (*) do "\7za.exe" u -t7z -m9=LZMA2 "%%A.7z" "%%A" That line was supposed to use a command line ...
0
votes
0answers
27 views

Automate the closure/reopening of browser windows

Aim:- To have an internet browser logged in to a live stream and automatically close at a set time, then reopen a new browser window to a different URL also logged in to a live stream. These windows ...
0
votes
2answers
54 views

Install from a .bat file

I have an old Mecer Notebook, at the school where I work, that is running Windows XP. My Principal has forgotten the password, but has asked me to see if I can get it working. I have tried everything! ...
1
vote
1answer
76 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 ...
0
votes
2answers
160 views

Batch file, script or shortcut to delete the most recent file in a specified folder

anyone know how to make a batch file or script or some other simple thing like a shortcut that calls some exe to do the following: I want to click on something (batch file, script or shortcut) that ...
1
vote
1answer
2k views

Using the taskkill command with a timer?

I using a custom .bat file that closes my chrome browser, but can't seem to find information on what syntax I need to add in order for the process to end after a given amount of time. Can anyone, at ...
2
votes
1answer
72 views

Windows batch equivalent of bash's set -e

Is there a Windows batch equivalent to bash's set -e, which causes the shell to exit immediately if a command fails with nonzero exit status (except in places where it's expected like in an if ...
1
vote
0answers
23 views
0
votes
1answer
84 views

Batch Script Doesnt Delete Folders in a Folder .txt File :(

My batch file's code is: for /f "delims=" %%f in (7profiledeletelist.txt) do rd /s /q "%%f" PAUSE exit In "7profiledeletelist.txt", there are: (will be deleted) C:\Users\1* (I tried *.* it didnt ...
0
votes
2answers
47 views

stopping/killing a process using command prompt without knowing the PID

I am starting a notepad from command prompt using the command: start notepad I am not aware of the PID of this instance of notepad. In such a case, how can I close the same instance of notepad using ...
9
votes
5answers
7k views

Moving hidden files/folders with the command-line or batch-file

Question Does anyone know of a way to move files and folders that have the hidden, system, or read-only attribute set from the command-line or a batch file? (No, stripping the attributes first is not ...
1
vote
1answer
40 views

How do I delete directory trees on remote via bat file?

I saw the question "How do I delete directory trees via console on Windows 7?" Would like to do the same thing with the following exceptions: The directory exists on an external drive . The path to ...
0
votes
0answers
148 views

Getting output of command and error code with psexec

I'm trying to run a script remotely. What I want is the output (text & error code) of the script. Instead, I am getting D:\BatchScripts\myscript.bat exited on \\my.test.place with error code 0. I ...
0
votes
0answers
69 views

Command to output its backend process

I have an application running in windows that has an option to run a command (UI base). I'm pretty sure that the UI base backend is running in a cmd but I dont know what is the exact bin file. The ...
3
votes
1answer
47 views

Index files and folders in windows

I want to create a database of all files and folders within a specific location (say, E:\movies). How can I do this? Is there any software which can do this for me? Otherwise do I need to write code ...
1
vote
2answers
76 views

Batch Script 32 bit limitation of integer

Is there any way I can over come the 32 bit limitation of integer math operation of Batch. I am doing some addition operation in my script and the sum value becomes more than the range( 2^31 -1). I ...
0
votes
2answers
1k views

Problems adding a prefix to bulk filenames using a batch file

I am trying to add a prefix to all filenames in a folder. After a couple of days of searching the internet I actually came up with something that almost work perfectly: echo Please specify ...
0
votes
3answers
1k views

windows 7 task schedule / mysqldump

Ive created a batch file to create a dump of a database and save it in a file with the current date as part of the file name. The batch file works brilliantly and all the data is saved correctly. ...
0
votes
2answers
26 views

Remove New Line at the beginning and '-' from the contents of file

I have a file with the below output. ---------- PFIZ_EXT_SEAGRCLMHISD_20141013_1.TXT: 165428 ---------- PFIZ_EXT_SEBMODCHKIND_20141013_1.TXT: 0 ---------- ...
4
votes
2answers
249 views

Replacing certain word in text file using Batch file

I am trying to use a batch file to determine the currently installed drive letter and to replace a keyword in the ini file with the drive letter. Basically the ini file contains: [app] ...
2
votes
1answer
409 views

How to remove .bat extension from file name in a parameter?

I made a bat file and during execution, it displays a title in the command window. The title includes the bat filename, and it is displayed in full, including the .bat extension. The code I'm ...