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
1
vote
0 answers

Do I need to have identical user account on different domains to run a net use command via batch script?

I have a Task Scheduler task that runs a batch file which copies a file from server1 to server2 on a different domain. Note:The scheduled task is running on Domain_A using user accounts created to run auto processes. Task Scheduler Task: Run under…
1
vote
1 answer

Windows batch file scripting: how to get directory named with latest date (yyyy-mm-dd format)?

I have a directory with many subdirectories. Each subdirectory is named with the yyyy-mm-dd format. I'm writing a Windows batch file and I need to grab the directory name with the most recent date and put that string into a variable. The last…
slantalpha
  • 305
  • 1
  • 5
  • 17
1
vote
2 answers

Does anyone have a Windows "at /every:" example to explain how to setup a batch file to run every day?

Microsoft documentation for the "AT" scheduler command shows that it has an /every: switch to schedule a script to reoccur on specified days. I've done it before, but I can't remember the syntax for that switch. The documentation does not include an…
1
vote
0 answers

How do I set up multiple unique accounts via command line?

I have to setup and configure about 60 (+ more in the future) windows 7 embedded PC's with the same settings. Each of these PC's will have 12 accounts on them. Each of the accounts will have their own unique settings, desktop, programs, etc. They…
1
vote
2 answers

How to uncheck the Validate server certificate option on the Authentication tab in the Network Connection on windows 10 via command line?

To deploy 802.1X configuration among lots of windows 10 workstations I'm looking for a way to uncheck the Validate server certificate option on the Authentication tab in the Network Connection on windows 10 via command line, or other batch…
jayatubi
  • 113
  • 1
  • 6
1
vote
1 answer

Scheduler not working on windows server 2016 EC2 instance aws, while EC2 is running?

I have setup a few batch files to execute python scripts on window. I have confirmed the batch files work by double click them which lauches CMD to show the scripts running. I have setup a task scheduler to kick off the batch files, and tested it…
1
vote
1 answer

Why my choice batch command always selects first integer choice?

I created a simple menu of choices of numbers like the following: @echo off CLS :MENU ECHO. ECHO ............................................... ECHO PRESS 1, 2 OR 3 to select your task, or 4 to EXIT. ECHO…
1
vote
1 answer

Add, remove, and test for the existence of a registry value * at the Command Prompt?

I am trying to check and update the network zone mapping in the registry from the Command Prompt. I need to check for the value named *. For example, under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet…
Jay Michaud
  • 3,973
  • 4
  • 23
  • 36
1
vote
0 answers

TaskScheduler trigger on specific task

I have a backup service running through TaskScheduler. The backup task runs a batch-file which does all the magic. Sometimes the backup fails which fills a log table until the server becomes unresponsive (this is a whoooole different issue...) I'm…
kumaheiyama
  • 111
  • 3
1
vote
1 answer

Network file handling

Using a batch file I'm trying to copy and then move a file from a local FTP folder to my pc. To access the local FTP I use the administration user and password. This how it looks. net use Z: "\\servername\FTP Folders\otherfolder" password…
M.Vielma
  • 11
  • 1
1
vote
0 answers

How to run cmd from PowerCLI Invoke-VMScript starting with an open console

I'm trying to run a exe file in a remote machine from PowerCLI which is launching couple of cmd's. With this command: $executeCommand = "call D:\MyFile.exe Arg1 Arg2"; Invoke-VMScript -VM $vmName -GuestUser $vmUser -GuestPassword $vmPass -ScriptText…
1
vote
2 answers

Difference between 'call perl script.pl' vs 'call script.pl' on Windows

On Windows servers (I've tested 2008 R2 and 2012 R2) we noticed different behavior in execution of Perl scripts that are called from batch. Consider a primitive batch file as follows: :beginlbl call path\script.pl goto :beginlbl Sooner or later…
1
vote
2 answers

Launch AD for alt domain batch stopped working after win10 upgrade

I have a simple batch script that I have been using to launch the AD Users and Computers modules for domains other than the one my current session is logged in to. I've been using this for longer than I can clearly remember, but since a recent…
1
vote
1 answer

Setting IP that i have pinged to be a variable

I am having great difficulty with a batch file i am working with. With the update i received below, i use nslookup to return the IP of the address. Is it possible to extract the IP returned with the nslookup command as a variable, and then edit the…
Alex
  • 21
  • 5
1
vote
1 answer

How to parse WMIC output in a batch file and compare to an array?

I’m writing a batch script to pull SCCM site codes from SCCM clients. I’d like to pull the clients site code and compare that to an array of site codes. If there is a match then I’ll uninstall the client. I have the uninstall portion. This has to be…
Javagenki
  • 13
  • 4