Questions tagged [batch-file]

batch files are simple text files executed in a command to achieve a particular task or a set of tasks

batch files are text files containing commands executed in sequence to achieve a particular task or a set of tasks. They can be very simple, or can contain complex logic.

440 questions
0
votes
1 answer

Automated SFTP transfer using WinSCP - how safe is it to store credentials in Windows environment variables?

I've had to implement an automated SFTP file transfer which requires a username and password. Not wanting to leave the password in a text file / batch script for the world to stumble across, I've elected to store the username and password in a…
0
votes
1 answer

robocopy retain files in destination directory

Is there a way to retain files/directories in the destination directory while still Mirroring the source directory Source --- A.txt B.txt Destination --- Z.txt Run robocopy Destination --- A.txt B.txt Z.txt
rookie01
  • 3
  • 2
0
votes
2 answers

Need relative paths from a batch script directory listing

I have a simple batch script that recursively looks at all files and folders within the directory and writes out the file inventory to a text file. It currently looks like this: dir /b/s > files.txt The /b means don't give any extra info and /s…
Mark
  • 2,041
  • 6
  • 19
  • 18
0
votes
1 answer

Alternative to SWARM FTP batch processing?

In a proposed project the plan is to divide large data sets into chunks, expose them by SFTP into a swarm CPU type of LAN cluster architecture for processing of historical numerical and financial data for simulations. Time consuming. What about…
ElHaix
  • 269
  • 3
  • 13
0
votes
1 answer

DOS Set variable only available after execution

I have a very simple script that I want to take a value from a text document (single line, one value) and pass it to taskkill - it needs to be a one liner too so I have: set /p pidtokill=
AskJarv
  • 25
  • 6
0
votes
1 answer

Skipping Command in CMD batch file

I'm using pstools to shutdown local pcs .. with different user & pass psshutdown \\10.0.0.1 -u 1 -p 1 psshutdown \\10.0.0.2 -u 2 -p 2 psshutdown \\10.0.0.3 -u 3 -p 3 problem is : if one of them is down the batch take a lot of time to move to…
D007a
  • 1
  • 1
0
votes
1 answer

Displaying dirsize in batch file windows server 2012 R2

I'm trying to display the dirsize with a batch file but so far no luck. DU, dirsize gives me a not recognized as an internal or external command error. This is my batch file so far, it displays all the dir's but not the size. dir D:\test\test2 PAUSE…
0
votes
1 answer

Running a Batch File from Task Scheduler With User credentials automatic fetch from directory

I'm trying to run a batch file on Windows 7 from the Task Scheduler. I can run the batch file fine if I run it from the command prompt and by storing user credentials in Task schedular. However, User's password changes per month so i need to find a…
0
votes
1 answer

Clearing Application Even Logs of specific application

Is it possible to clear event logs of specific application (specific "Source" in Windows Event Log Viewer) via batch file? Thanks.
flamey
  • 125
  • 3
0
votes
1 answer

Batch file fails to run all lines when called from task manager

I have a .bat file that consists of 450 lines of: start [executable] [params] Presently all the lines are perfectly identical. If I run the bat file manually, I end up with 450 instances of the executable running. If I set up a task in task…
0
votes
1 answer

wait until completing WMIC process call create cmd.exe to run bat

I'm running a bat file located on a remote server. The command is: wmic /node:[server name] process call create "cmd.exe /c [bat file location]. I would like the command to wait until the batch file execution completing. In other words: the command…
Guy E
  • 101
  • 1
  • 2
0
votes
1 answer

How to select a daterange of files and archive them?

We have 4 servers (Windows 2003 R2), each with a log-directory with thousands of log-files. I have written a log-viewer that collect log-files within a date range and show them in a grid. But this is rather slow as the number of log-files grow…
berocoder
  • 197
  • 2
  • 9
0
votes
0 answers

Start/Stop services using bat file in Windows server 2012

In our old 2003 server, we were able to start and stop services by using a bat file(with net stop and net start commands). When ever the services stops(MQ listner services), we force start an autosys job which will trigger the bat script to start…
Raghav
  • 21
  • 1
  • 3
0
votes
2 answers

Install Application using a batch file

I work at a company and I have to write a script that silently installs applications to thousands of users. I know how to do that but the only problem is this specific application has certain things that have to be selected while in the installation…
Yaffai313
  • 1
  • 1
0
votes
2 answers

Run Log-on Script with Admin Rights

I created a batch logon script that checks and removes old versions of a specific piece of software and installs the newest version. Both the install and uninstall process use an .EXE file. The script works great if the user is an administrator, but…
iFetus
  • 13
  • 1
  • 5