Tagged Questions
0
votes
1answer
32 views
Get Multiple NICs Speed 10/100/1000
I have the following batch file, however, it freaks out if you have more than one NIC enabled and spits out output of Speed for the first NIC it reports, but for any more, it reports
Speed = Missing ...
0
votes
1answer
42 views
How to get drive letter of mapped network drive
I need to create a script or batch file to run on multiple computers that unmaps a network share \\serverName\shareName and maps a new network share \\newServer\newShareName
I can unmap the network ...
-1
votes
1answer
26 views
Batch File to copy and rename if
I am looking to create a batch file that will check the date of a file in the destination directory and if the copy of the file in the source directory is newer rename the existing file in the ...
2
votes
1answer
57 views
batch script to create random users in active directory/local system
I'm trying to create a batch script that will insert random users into a system (with a random password):
So far I have:
@TITLE New User Creation
@ECHO Creating a new user . . .
for /l %%x in (1, ...
3
votes
2answers
52 views
Batch script that makes a numbered menu to view log files
I have recently started to learn how to make batch files. I have a folder that contains bunch of internet related log files. When I run the .cmd file (located in the same folder) I want it to be able ...
1
vote
2answers
44 views
Scripting with Batch Files in DOS (NT) Windows Server 2008
I'm trying to go around the loop a fixed number of times, however I find I cannot seem to make this statement work with
REM @echo off
SET TotalCores=12
SET Sockets=2
SET SlaveNodes=4
SET /A mycores = ...
0
votes
0answers
23 views
Edit a file behind a custom directory
I am attempting to edit a file behind a custom directory, preferably with a batch file as I am very new to scripting. Is there a way to cd to a location ...
-2
votes
1answer
47 views
Need Help Writing A Batch Script To Move Certain Files From One Folder To Another
I need help writing a batch script I can run that will take a list of file names ["FileA.jpg", "FileB.jpg", "FileC.jpg"](These file names can be either in a text format or a csv) and finds those files ...
1
vote
1answer
74 views
Batch file to search list of PCs for a folder/file and create log file
I am trying to get a script to seach all the pcs on my network and tell me if a folder is present within the C directory.
Here's the script I've got so far, it is working but it is not pulling ...
0
votes
2answers
32 views
Batch File input validation - Make sure user entered correct format
I'm using simple batch-file techniques to get user input:
@ECHO OFF
SET /P UserInput=Please Enter Version as X.X.X.X:
Do you know how X.X.X.X can be validated where X are numbers?
for example:
...
1
vote
2answers
65 views
Please explain usage for for/f command?
I am using the following to output the java version which I grabbed from another site:
java -version 2> java.txt
for /f "tokens=3" %%x in ('find /i "java version" java.txt')
Output is:
java ...
0
votes
1answer
32 views
Script to configure install variables and output correct install switches
I need help with a script that will pull the hostname or username of a user logged in a windows computer and compare it against a table of hostnames or usernames and add the right variable.
EX.
...
4
votes
1answer
49 views
Directory listing is slow when doing it in a batch script
Hello StackOverflow members!
I am trying to run the following command:
REM the below line lists the folder names that are to be read
FOR /F "TOKENS=* DELIMS=" %%d in (%start_dir%\folder_list.txt) DO ...
-2
votes
1answer
53 views
which is faster java or batch scripting [closed]
I want to traverse few folders (which have subfolders and files in that) to search some word in the file and want to get line number, last modified date as result.
Which is the better and efficient ...
0
votes
1answer
20 views
Redirecting output to a file also includes the name of the file I'm redirecting to?
I'm using a simple directory command
I have one file in the directory
C:\tokyo\scripts\notempty>dir /b /a-d
1.pst
So far so good
When I redirect the result into a file
...
0
votes
1answer
89 views
Batch copy files from list of server
From this line of code :
robocopy "\\NAMEOFMACHINE\C$\Users\MAIN USER\Favorites\Links" "%USERPROFILE%\Favorites\Links" /mir
I want to have to possibility to add a list of server to push this ...
-1
votes
1answer
56 views
Comparing and moving sets of files
I need a batch file that looks in a file and moves a set of files
the problem is, is that it will need to compare files as there may be more than 1 set
the files correspond to each other
the ...
0
votes
2answers
120 views
Batch - Reboot computer if a batch file ends
Essentially we have 2 batch files, one which is the "wrapper" if you will, calling another batch file so it starts as /min (minimized). This batch file then ends once it has launched the 2nd batch ...
0
votes
1answer
96 views
copy folder to multiple servers with different %userprofile%
I do not have access to GPO or AD/OU, so what I found to do the easiest was to create a batch file for users.
Here is what I want to achieve :
I have over 50 servers, and 10 users that will be ...
0
votes
1answer
345 views
Windows Batch File - Net Use encounter “System Error 64”
Been encountering this error "System error 64 - the specified network name is no longer available" in one of my windows batch script while trying to NET USE \server\drive\folder to connect to a ...
-2
votes
3answers
39 views
creating a batch file
I would like to creat a batch file that will recognise folders date moidified in a network drive and then copy them to another network drive
while I was searching I found way to do that to files, but ...
0
votes
2answers
30 views
Rename A Group Of Files
I need to rename a group of files in the same folder.
When I try to run the batch file, it doesn't work correctly:
`ren *.txt Updated_*.txt`
The file names contain date_names_location.txt, ...
0
votes
0answers
22 views
batch file skip record
Below is a batch file to redirect the first field of all files to a new file.
I am looking for a method to also skip the first record.
@echo off
for %%x in (*.csv) do (
type nul>"%%~nx.new"
...
1
vote
1answer
32 views
Batch file output to a new file
I am working with a few csv files that I need to output to another file using a Windows Batch file.
The batch file contents is below:
'@echo off
'(for /F "delims=," %%A in (input1.csv) do echo %%A) > ...
1
vote
1answer
86 views
Start 2 application windows 8 batch
I'm attempting to run two applications at the same time in Windows 8 via a batch file.
The standard way is:
START "NOTEPAD++" "C:\Program Files (x86)\Notepad++\notepad++.exe"
START "MACTALK" ...
0
votes
1answer
228 views
Batch file that creates text file, called from another program
I am trying to run a batch file from a different program.
When I run the batch file manually (double clicking the file) it behaves as expected and creates a text file as a result. But when I call the ...
1
vote
2answers
72 views
How to pass the REG QUERY value to if, then statement
I'm trying to create a batch file to check for Office 2010 Bitness. If it's x86 I want to install the x86 version of an application, and if not the x64 version.
I am running a REG QUERY to find this ...
0
votes
1answer
59 views
Copying files and renaming files into the original folder using Powershell
I am very new to the scripting process. I've been googling my problem for over a week, and have found snippets of pieces of what I need, but I can't figure out how to put it all together.
I need ...
1
vote
2answers
45 views
Stopping when a string has been found
Hello StackOverflow community!
I have a BATCH question that has been plaguing me for a few days now:
I am trying to do a sting comparison (sounds simple) but I am doing it in this manner:
I have two ...
1
vote
3answers
146 views
batch script to extract lines between two specified lines
I have a text file and would like to extract all the lines between two specified lines using windows batch scripting.
Line1: !FILE_FORMAT=ADS
Line2: !VERSION=1.0
.
.
LineX: ...
0
votes
1answer
92 views
Windows batch equivalent of “fuser -k <folder>”
I have a Unix shell script which will kill any process that is accessing a folder:
fuser -k ..\logs\*
Is there a Windows batch script equivalent to this? I am aware of TASKKILL but I'm not sure if ...
-3
votes
1answer
57 views
Batch file script to parse and edit large block of text [closed]
I have a text file where a very long block of text, usually around 600 alpha-numeric characters (no spaces), is the only contents of the file. I need to parse that block of text and do a sort-of-hash ...
1
vote
2answers
96 views
Batch Script Parsing Dir Command
Hello newbie looking for some help. I am trying to write a script to search all files and folders in my drive which have a certain identifier. For example "ID -"
I was using the following to get ...
1
vote
2answers
275 views
Batch script: The syntax of the command is incorrect - when script is going trough subdirectories?
Hello folks,
my problem is probably very simple.
When I`m trying to use /r as a reference for batch script to go trough all the folders and subs in order to execute this small script I get the ...
3
votes
2answers
662 views
How To Automate A Telnet Session Without SendKeys
I have Windows 7, and I would like to check my routers CPU usage, to see if it is why it is slowing down. I can get telnet access to it and I want to automate it so I can look at it any time that I ...
0
votes
2answers
40 views
Batch Echoing from Lateral to Horizontal
I have the following issue: A regular list with this approximate information:
Computer1
DateImplemented
Computer2
DateImplemented
Computer3
DateImplemented
<this goes on for a while>
What I ...
1
vote
2answers
74 views
How to add a file thats copied from one directory to a folder in another directory thats incremented
I am making a batch file that copies my Google bookmarks and pastes them into another folder ( Kinda like a backup) called " backup of bookmarks". I wanted to make the script run every day at the end ...
0
votes
2answers
56 views
Reconfigure windows after installation
I am looking to reconfigure Windows 8 after it has already been installed. Basically I have a base image that I will apply. After that is complete, I want to be able to run either a script of an exe ...
0
votes
1answer
774 views
Reg Query Batch File
To summarise what I want to achieve, I want to query 2 keys, if they exist go to end of batch file, if not install Java.
The batch file is installing Java fine, but when testing if I delete the .txt ...
1
vote
1answer
224 views
how to execute a batch file from a website
I know this sounds fishy, but I'm trying to run a batch file from a website. Our users are seniors that wouldn't know how to do anything with a computer. Our software is a replacement for the windows ...
0
votes
1answer
55 views
Copying and renaming a file into the proper subdirectories
I have a particularly tricky batch scripting request. I have a file/folder structure like this
/mapcfgs/
/folder 1/
somefile.new
somefile.old
/folder 2/
someotherfile.new
...
1
vote
1answer
569 views
Merge Two text files line by line using batch script
I have 2 text files; A.txt and B.txt and I want to merge them to make C.txt using a batch script.
However (here's the tricky part) I wish to do it so each line from A.txt is appended with a space ...
0
votes
2answers
82 views
Replacing a string in all config files across machines with a script
I have the below task and I am wondering what would be the best and quick way to do this. I am thinking scripting rather than a C# app but struggling with scripting in DOS. I wanted to use powershell ...
0
votes
1answer
51 views
Batch print out exit code of the scipt
Hi lets say i have batch script that returns 0 on success and 1 on error
and i want to print/pass exiting value to console/another command
something like
echo script param1 param2
expected output
...
0
votes
2answers
22 views
saving output as variable
I am working on a batch script and am trying to save part of the output of a command as a variable. My current script requires the user to enter a site code (e.g. 853), and it takes that code and uses ...
0
votes
2answers
211 views
vbscript to get the files in a format from ftp with today's modified date
I have a requirement to get the files in a specified format from a ftp using vbscript. Can any one help me on this.
I have to get files with name format VarList12DDMMYYYY******.csv, ...
0
votes
2answers
324 views
How to replicate a directory structure using xcopy in windows
I have a text file containing a list of folders.My text file looks like this:
"D:\old\FOLDER1"
"D:\old\FOLDER2"
"D:\old\FOLDER3"
"D:\old\FOLDER4"
"D:\old\FOLDER5"
all these folders have ...
0
votes
0answers
77 views
Illegal Method name when running scala windows batch scripts that resolve dependencies
I am trying to have scala scripts run within my windows environment. I was adapting the methods described here and here
So I've copied and modified my sbt.bat file into scalas.bat, and added the ...
0
votes
4answers
80 views
Variable usage in batch file
I'm working with a fairly simple batch file in Windows 7, where I want to be able to define a few variables and then use them in a command. This is the code I have so far:
@ECHO OFF
set ...
0
votes
2answers
39 views
Retrieve seconds, along with date and time in CMD?
I'm trying to ping an IP, and receive the time date and seconds to a file.
I'm running the command date/t&&time/t&&ping That gives me 09:50 PM and Sat 05/25/13, but is there anyway I ...