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
2
votes
4 answers

Create a Windows shortcut through a batch file (.bat)

Is it possible to create a shortcut from a .exe using batch scripting?
Luca Matteis
  • 548
  • 4
  • 11
  • 21
2
votes
4 answers

Is it possible to insert a timed pause into batch files?

Is it possible to insert a timed pause in a DOS batch file? It should act like the pause command, but instead of having to hit any key, it will continue on its own in X seconds.
ToastMan
  • 544
  • 4
  • 18
  • 29
2
votes
1 answer

SQL, pl/sql, sqlplus: how to return a variable to DOS batch file?

I have a DOS batch file which invokes sqlplus, which executes some basic SQL contained in another .sql file, and I want the last part of it to return a value back to the dos batch file. However, while there are many examples via Google on how to do…
weiji
  • 268
  • 1
  • 3
  • 10
2
votes
2 answers

Running a bat file in XP as a windows service

Im using Windows XP and i want to run a particular bat file as a windows service.Is there any way to do that ? Please Help Thank You
Tom
2
votes
1 answer

Is there a & (BASH) equivalent for DOS Batch files?

I'm thinking not since that violates the principle of batching. So what are my options if I want to launch two apps in windows in one script.
Peter Turner
  • 2,178
  • 9
  • 33
  • 45
2
votes
2 answers

Batch Script to restart service

Can anyone help with a peice of batch script to restart an application service at scheduled time. For example: If the service is "windows firewall " Then the script should restart this service every day at 09:00 AM and 09:00PM . Can someone help…
user39039
  • 21
  • 1
  • 2
2
votes
1 answer

Using systeminfo to get the OS Name

I need to find the flavor of Windows that is running using a batch file that will run on anything from Windows NT to Windows 7. I'm using a method based on this page with some minor changes. Systeminfo gives the flavor of Windows that is running. Is…
WileCau
  • 173
  • 1
  • 6
2
votes
3 answers

Can I copy a file from the Web to a local machine at the command line?

Is it possible to copy a file at a HTTP:// URL to a local directory in a BAT or CMD file?
Doug
2
votes
4 answers

How to partition and format multiple disks using a batch script?

I am trying to format 'n' number of disks using a batch script. My script goes like this. diskpart /s "abc.txt" where abc.txt is: sel disk 1 create part primary format FS=NTFS label=label2 quick compress My Problem here is I want to 'loop' the…
chandu
2
votes
5 answers

Run a batch file silently, executed at remote desktop login

In our office we are using Linux thin client machines, they work very well except the lack of IE, which is a pain because the corporations we deal with are too stupid to update their web apps (no flame wars please). To solve this problem we have…
Ben Everard
  • 599
  • 3
  • 7
  • 22
2
votes
3 answers

Batch file creation for restarting services remotely

Need to create a batch file for restarting some services remotely and restarting iis remotely in Admin mode. Help would be appreciated Thanks krish
krish
  • 25
  • 3
  • 6
2
votes
1 answer

How to Disable Ctrl-C /Ctrl-S While Running a Batch File

By default, batch files can be terminated when the user presses Ctrl-C and can be paused by pressing Ctrl-S. Is there a way to disable this? The MS-DOS BREAK command apparently used to do this, but it is now ignored in Windows. I need something…
user33852
2
votes
1 answer

How can I get a list of active directory group members that are not disabled (without using PowerShell?)

I'm trying to get a list of users that are members of an Active Directory group that are not disabled. The best I've been able to find so far is: dsquery group -name "Group name" | dsget group -members -expand | dsget user -samid -disabled -c |…
1
vote
1 answer

Having issues with mkdir, robocopy, to date\time folders in a looping batch file

I have searched everywhere but cannot find a solution. Im unsure what is going on here but I desperately need some help in regards to this issue, Im running a batch file (Script for a game Server monitor/crash restarter). I decided to add a Log file…
1
vote
2 answers

Advanced PDF File Associations on Domain

I have a complex setup that I'm having issues getting to work properly. Microsoft is so aggressive at defaulting PDFs to Edge. Edge gives our organization so many problems when working with PDFs and is one of our largest helpdesk woes. We need to…