Questions tagged [batch]

A batch file is the name given to a type of script file, a text file containing a series of commands to be executed by the command interpreter under MS-DOS and Microsoft Windows.

This was the first extension used by Microsoft for batch files. This extension runs with MS-DOS and all versions of Windows, under COMMAND.COM or cmd.exe, which execute its commands, normally line-by-line.

339 questions
0
votes
1 answer

How to reference Domain-Admins with icacls?

I need to reference the "Domain-Admins" group in a batch file. The line in question looks like this: icacls "test\folder" /grant mydomain.com\Domain-Admins:F ... and works as expected. But how do I reference the "Domain-Admin" group in general? My…
bjoster
  • 4,805
  • 5
  • 25
  • 33
0
votes
1 answer

Windows batch find folder if statement

Assume a file system with the following format Folder A --->Folder 1 --->Folder 2 --->Folder 3 etc.. Folder B --->Folder 4 --->Folder 2 --->Folder 3 Folder C --->Folder 1 --->Folder 2 --->Folder 3 --->Folder 4 I need to go one level deep, and…
0
votes
1 answer

"Access is denied", only when trying to run script over telnet

I have a batch script that restarts a Windows Service with: Net stop Net start I got around having to manually run it as Admin by creating a shortcut to it and marking this shortcut to always run as Admin. By then…
Thom Shutt
  • 103
  • 1
  • 3
0
votes
1 answer

Automatically restore windows network drive (red "X") via batch file

i need check if a network drive is mapped and accessible. From time to time windows displays a red X on the drive, and i would need to manually click the drive in explorer to reconnect. I already found solutions which involve editing the registry…
user33958
  • 1
  • 1
  • 1
0
votes
1 answer

Exporting Windows Registry settings by batch file

I am writing a batch file to migrate certain settings from one windows machine to another. I'm having problems with the regedit /e switch. In the script, I'm exporting ODBC system entries and Internet Explorer Trusted Sites. The ODBC command exports…
DeskSide
  • 13
  • 1
  • 4
0
votes
3 answers

Is there a way to reset the password for a list of Active Directory users en-mass?

I have a list of user accounts that need their password reset to a default password (also users will be required to change the password at first login). Is there a way to reset the password for a list of Active Directory users en-mass? I'd rather…
user134977
  • 1
  • 1
  • 1
0
votes
1 answer

How to remove a line in a file found in multiple directories

There is file that exists in each user profile directory and I need to remove the line from the file in each user profile directory. I'm using a batch script to go through each user profile directory, type the file, use findstr to not display the…
hsatterwhite
  • 332
  • 2
  • 5
  • 14
0
votes
4 answers

Command Line Winrar & Batch Scripts

I've written a wee batch script to backup some stuff on my desktop and dump it over the network to a share... The only thing that's bugging me is the verbosity of rar.exe while it's doing the compress part of the job. Anyone know if it's possible…
Eoin Campbell
  • 105
  • 1
  • 1
  • 7
0
votes
5 answers

Windows XP batch file to block all incoming and outgoing traffic

Is it possible to block all incoming and outgoing traffic on a Windows XP host via batch file? Bonus question, I only want to allow 1 outgoing port and all traffic going over that port.
0
votes
2 answers

Transferring files from ftp to local system

I want to copy a file from FTP and paste it to my local system. I want to run this through a batch file. I am trying this for a week. But I couldn't find the solution. Anyone help me please.... This is my actual work Want to copy a file named…
Phillips
  • 1
  • 1
  • 2
0
votes
1 answer

Test the proper execution and integrity of a backup

Every night my company generates automated backup all our servers on a backup server: -- backups folder ---- server1 backups folder ------ server1_backup_files.7z ------ server1_backup_db.7z ---- server2 backups folder ------…
GG.
  • 187
  • 1
  • 9
0
votes
1 answer

Creating Directories with a Batch file

I am intested in creating a batch file that can read in a text file which has four variables: customer name, customer number, customer order, products orders. I am using: FOR /F "delims=, tokens=1,2,3,4" %%f in (test.txt)do md…
0
votes
1 answer

Problems encoding an HTA file to run Java+Batch files for DNS server

I'm having a problem coding a .HTA file, and I really need some help. I've been searching all over the place and I can't seem to find what I need to add to this code to make it run. I'm trying to get the HTA script (running javascript) to, utilizing…
0
votes
2 answers

Remote GPO through BATCH Script exiting

Right so, I'm trying to make a remote GPO script that from one of our management machines will push the GPUPDATE command to certain servers. After some googling I found a script that I tried to adapt / make run. The problem however is that when I…
0
votes
3 answers

Deleting the oldest file in a folder with batch scripting

I have to write a batch file to delete the oldest file in a folder, but i don't know how to get the name of the oldest file. I can sort files with DIR, DIR /B /O:D /T:C but this is a list and i need the first file (since it sorts the oldest first)…
Hayri Uğur Koltuk
  • 103
  • 1
  • 1
  • 4