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

Stopping a scheduled task with WMIC

I need to find some method for disabling a scheduled task on a remote machine and waiting until that task has stopped executing if it happens to be running at the moment. I'd like to do this through WMIC if possible. This will be integrated into a…
3
votes
1 answer

batch - File last modification time with seconds

I want to know when a file has been modified for the last time. I can get these infos using the following batch script: FOR %%i IN (myfile) DO SET modif_time=%%~ti The problem is how to get the second of the last modification ? and the command %~t…
3
votes
5 answers

How would you run an application off a network share so you can update application?

We have an internal desktop application which we have deployed to a network share. In that directory are subdirectories for each version, ie, z:\Apps\ApplicationX\1.0 z:\Apps\ApplicationX\2.0 z:\Apps\ApplicationX\2.1 I would like to put a shortcut…
Benjamin Peikes
  • 1,094
  • 3
  • 16
  • 26
3
votes
3 answers

Can't run batch files from server, Users do not have permission to access file

We're trying to run some logon / logoff scripts on server 2008r2 domain controller. The script is located in the default group policy logoff directory \\domain.local\SysVol\domain.local\Policies\{guid}\User\Scripts\Logoff Nothing was happening at…
ASGJim
  • 117
  • 2
  • 4
  • 11
3
votes
9 answers

what is good way to protect batch file?

I have batch scripts that are scheduled to run daily. Some of the scripts have password in them. I'd like to protect the batch from being read or opened by those not authorized to open or read them. My question is: What is a good way to protect…
titanium
  • 111
  • 1
  • 3
  • 6
3
votes
2 answers

Batch rename removing second letter in filename

I have about 300 .pst files that I have exported from Exchange 2010. Eventually, I'm going to import them into another Exchange/AD environment. In the original environment, the user names are as follows: FirstinitialMiddleInitialLastName i.e. Bart…
Tyler Miranda
  • 73
  • 2
  • 9
3
votes
2 answers

Scheduled task fails, but runs fine when triggered manually

We have a 2008 R2 server with a scheduled task that runs a .bat file which executes a call to a Java app. The task triggers just fine, but stops executing anything after it creates the log file. Here's the details on how it's set up: It runs on a…
3
votes
2 answers

Windows Batch folder size

I need a command (like "dir") that lists all directories with their size. I need just a 1 level deepness but with the total size of a directory. For example >dirsize c:/mainfolder subfolder1 15640 subfolder2 682310 subfolder3 283550
Tobia
  • 1,272
  • 9
  • 41
  • 81
3
votes
2 answers

Run exe on computer in network through batch file

I have few computers connected to the network and I want to create batch files to automatize the process of working with them. I have already created one used to shutdown computers at once. It is very simple I ll just post it for the sake of…
Peter Kottas
3
votes
1 answer

Detecting a registry key with a space in the path from the CLI (or .bat file)?

I've run into a problem in which my experience (and Google-fu) have let me down. Basically, I need to push out KB968730 to a couple hundred clients or so. Naturally, would like to check for the installation of the hotfix before kicking off the…
HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
3
votes
1 answer

Move directory in DOS (batch file) without knowing full directory name

In Bash I can move a directory without know the full directory name like so: mv gradle-*/ gradle/ How do I do this in cmd (i.e. batch file, not powershell). The move command doesn't seem to allow this.
vicsz
  • 133
  • 1
  • 5
3
votes
2 answers

How to create a windows batch file that sends a file to a bluetooth device?

I'm always sending one file to a device. The device is always the same and the file has the same path and name. How do I write a batch file to do this?
Daniel Moura
  • 215
  • 2
  • 11
3
votes
3 answers

Script to delete temp files for all users in XP, Vista, and 7

Basically, we have numerous customers running XP and 7 with a few Vista machines. I've found this batch script, but it is limited to the current user (uses the %userprofile% environment variable). I'm looking for something like this, but which would…
Chris
  • 39
  • 1
  • 1
  • 3
3
votes
2 answers

What rights does an account require to log on as a batch job?

I've got a Windows batch script which I'm trying to get Veritas Cluster Server to control using the process agent. The batch script needs to run as a particular user, but when I try to online the resource I get the following error in the event…
hmallett
  • 2,455
  • 14
  • 26
3
votes
2 answers

Can I change Internet Explorer security settings using a script?

Is it possible to change Internet Explorer security settings using a .bat or .vbs file? Basically, I need to change IE7 and IE8 security settings for the local intranet. The settings I want to change are: Display video and animation on a webpage…
nami
  • 131
  • 1
  • 1
  • 2