Questions tagged [batch-file]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
29 views

Execute batch file from server on client computers using php [closed]

Hi all my server is using windows server 2012 and hosting an intranet using joomla via the latest wampserver. I've been tasked with linking a portable program which is shared via UNC to the intranet ...
0
votes
1answer
31 views

Get the previous day date as variable in batch file from powershell command output

The scenario is like this. I need a previous day date (i.e. Today -1) as variable in a batch file. But if previous day is Sunday (i.e. script running on Monday) it should return the Saturday's date (i....
0
votes
1answer
37 views

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

Scheduled task on VM only works interactively/manually

I am trying to get a scheduled task to run on a Windows Server 2012 R2 virtual machine. When I RDP in and test the task, everything works manually. The task is scheduled to run nightly and it appears ...
0
votes
0answers
11 views

SimpleDNS Plus command line for updating DKIM TXT records

Is anyone using SimpleDNS Plus command lines to update their DNS records? (Is it at all possible?) I would like to automate the DKIM record keeping; coding a batch file that would: update ...
0
votes
0answers
21 views

Issue with windows logon script asking for UAC

Currently have a logon script running on multiple user accounts. Whenever a standard user logs onto their computers they are prompted with Windows 10 users account control. The script will not run ...
3
votes
1answer
164 views

Command understanding in Batch script

I have a batch file which invokes a tool. Now i face an issue in the batch file at a for loop. But with all research about the Batch script, I am still not able to make out what the expression is ...
0
votes
0answers
64 views

Windows Update killed server reboot batch job. Is there a replacement?

I have been creating a scheduled task with powershell to use a group managed service account (the only kind allowed) on Window Server 2016. Did this approximately one year ago on 5 2016 VM's, and it's ...
0
votes
1answer
141 views

Prevent Windows PowerShell console from flashing up

CustomApp is registered with a URI Scheme in Windows 10 so it launches when Chrome browser visits CustomApp://userid@departmentid Computer\HKEY_CLASSES_ROOT\CustomApp\shell\open\command C:\Windows\...
0
votes
1answer
81 views

passing exe to non-admin user outside network to install software

I'm in a dead end now and need your help. I tried everything I could find on the web, but didn't succeed. I have hundreds of non-admin domain users working on their Windows 10 laptops outside our ...
1
vote
1answer
133 views

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 ...
0
votes
0answers
25 views

bat file logging: net use not logging failures

Edit, solved; "2>&1" needed. Line 3; call :Logit >> %LOGFILE% 2>&1 Issue; In the batch file below if the net use command works it will put an entry "The command completed successfully." in ...
0
votes
0answers
24 views

Access Denied - every once in a while

We have some batch files that are launched via Task Scheduler, that map a network drive if it isn't already mapped, and then moves to a folder on that drive, and launches an executable. Launching ...
0
votes
0answers
59 views

Robocopy move files from a directory but keep some files

I am trying to move files from one folder to another when it reaches a limit, and keep some files in the source using batch scripting. I tried with move but the source folder is read by another ...
0
votes
0answers
156 views

Scheduled task returns error 0xff but success

I have a scheduled task that runs a batch file, and even though I can see the results of it completing successfully, according to the task scheduler it fails with error 0xff, every time. title ...
1
vote
2answers
46 views

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 ...
0
votes
2answers
210 views

remotely destroy all data windows 7 [closed]

we are downsizing our organization and closing several stores. This may sound malicious but actually involves complete remote data destruction for company equipment. My team has been tasked with ...
0
votes
1answer
42 views

Running batchfile admin to set envirnment var

I am running into an issue here on Windows 10. I am trying to set an environment variable within the batch file using a for ... in ... do, but it never finds the file folder I am looking for. ...
0
votes
0answers
29 views

Tomcat installation parameter for 'JvmOptions' are not reflecting

I am installing Tomcat8.5 on Windows Server 2012R2 as a services. The following custom batch files is executed for optimization. It installs tomcat as a services, but JvmOptions are note reflected in ...
1
vote
0answers
49 views

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 ...
0
votes
1answer
170 views

Batch: Passing 'Enter Key' into Nested Programs (Program Ran by MPIExec)

What i need: To send "enter" key when batch is still processing a previous line. I am trying to use batch to have an .exe run through a series of input files. The batch file below runs a program, ...
0
votes
1answer
96 views

can you sum within a function or use '!' within '!' in cmd?

Having some difficulty with the delayedexpansion in cmd. This might be a stupid question but is there any way of summing within a function (ie without 'set') or using ! within ! (or something to ...
1
vote
1answer
407 views

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 ...
0
votes
0answers
49 views

How to delete all files and subfolders older than 5 days by cmd call [duplicate]

I use Windows. I want to delete all files and subfolders older than 5 days by system call. I have this command, but i want to delete all files and subfolders older than 5 days. FOR /D %i IN (C:\...
0
votes
1answer
189 views

Copy files and folders by specific days of the month

I'd like to create a batch file to copy the files and folders by specific days. For example, 15th and 30th of the month(not 15th to 30th) copy the files and folder to another location. How can I write ...
2
votes
1answer
460 views

Windows Command - Delayed Expansion Syntax to Echo The VALUE of a Variable That Contains Another Number Variable

I am trying to echo the VALUE of a variable whose name contains another variable ($project!$project_number!_control) while using delayed expansion. I can't figure out the syntax to do this. Here's ...
0
votes
1answer
28 views

Installing operating system from server PC to all the client PC

I am working on the project in which I have decided to install operating system from server PC to all the client PC. I have one windows iso file on the server PC which is shared on the network. This ...
0
votes
1answer
244 views

Scheduled powershell to replace batch file ends too soon or never ends [closed]

First I'll explain the context, because maybe I'm not doing it in the right way. We have an ERP developed using Oracle Forms 6i (yes, is really old). It has forms and reports. Reports have such ...
0
votes
1answer
706 views

Pass PIDs from tasklist and kill processes with tasklist WITH spaces in the name of the process

So this question is VERY similar to this question, with this answer. But some of my processes have a space in the name, and CMD returns nothing. My original question has been answered in this answer, ...
12
votes
2answers
46k views

call batch file and run using its own path/directory

I have a batch files that calls other batch files like this: e:\foo\master.bat has the content: call e:\bar\run1.bat and e:\bar\run1.bat has the content app1.exe the problem is that when I run ...
1
vote
0answers
28 views

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 ...
1
vote
2answers
3k views

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 ...
2
votes
2answers
2k views

Change directory to “This PC” / “Computer” from .BAT batch file

I'm using a batch file to automatically launch a software at login. This software maps a remote drives to which one letter is assigned (R:) and opens the file explorer to R:. I would like to append a ...
0
votes
1answer
727 views

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 ...
2
votes
1answer
13k views

Copy single file using robocopy

I'm writing on a batch file to copy a certain file to a samba-share. I've already read robocopy transfer file and not folder and thought I would be good using robocopy "E:\Some\Path\with spaces" "\\...
0
votes
1answer
961 views

Q: How do i Activate Robocopy with /B (or /ZB) Flags?

Robocopy is failing when it is activated by clicking on my "run_bckup.bat" file. Although the batch file has Admin-privileges, the following line fails: Robocopy "%src%" "%trgt%" .. /B .. But ...
3
votes
2answers
1k views

How to check that mstsc.exe has successfully set up a RDP connection?

We use mstsc.exe to establish RDP connections to other servers in batch files, which are then terminated after some tasks have been run. This basically works fine, but every now and then it takes ...
2
votes
0answers
2k views

Windows Task Scheduler job not starting but runs on manual start

Windows Server Version : 2016 Problem Description : This is indeed a weird problem I am facing. I have a .bat file that I have scheduled to run every 15 min but it does not start on its own at the ...
1
vote
1answer
638 views

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 ...
0
votes
1answer
627 views

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 -...
1
vote
1answer
596 views

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....
-1
votes
2answers
137 views

How to create a batch file which after some time execute a file but if interrupted execute another?

I want to automate my ms office installation 2007 or 2010 running a batch file. I am thinking having an options menu 1.Office 2007 2.Office2010 When started I want my timer to start..lets say 20secs ...
0
votes
1answer
27 views

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 ...
1
vote
1answer
1k views

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\...
1
vote
1answer
20k views

Run a batch file from network shared folder depending on MS outlook bit version

Hello I'm trying to figure out on how to Run a file from network, basically it's located from \10.18.xx.xx\installers\install.bat, so yeah It's gonna prompt a username and password when I locate it ...
1
vote
0answers
664 views

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 ...
3
votes
1answer
19k views

Script for renaming files and adding a timestamp (server 2012 r2)

I'm struggling to create a (fairly simple) batch file script that meets these requirements: Looks in the folder called Source for a file (with any name.csv) Renames the file to ...
0
votes
1answer
45 views

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=<C:\temp\...
1
vote
1answer
97 views

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: "\\...
0
votes
1answer
564 views

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 ...

1
2 3 4 5
9