Schedule a Batch File

Schedule a Batch File

Question:
I need to schedule a batch file to automatically run at night. I have tried every variation of the “AT” command from a command line on the Windows NT Server (NT4) and it will not execute the batch file.

If I run the batch file manually from the command line, everything works just fine. What I entered for the “AT” command was: at 7:30 /next:Th cmd /c c:atchfilename.cmd

I’ve tried with and without quotation marks around the path & file name AND tried including the cmd portion inside the quotation marks AND using cmd.exe AND every other variation I could think of. Nothing works. What is the correct format? I’ve even gone to the Microsoft site and tried what they state is the proper syntax?it didn’t work

begin batch file:@echo offrem delete any current share using drive letter Enet use e: /deleterem create a share to the datanet use e: \scsm1d$ password /user:domainaccountrem jump to the folder the data will be xcopied toh:cdscsm1.bakrem delete all existing files in the foldererase *.* /f/q/srem copy all files in all subdirectories even if errorsxcopy e:public /s/e/v/r/h/q/cend batch file

Any help would be greatly appreciated.

Answer:
Yep, I know exactly what is happening. From the command line, the batch file is running under your security account?from the AT schedule command, it is running in the context of the System Account. The System account has 100% rights on the local machine, and 0% rights to use network services. So, when you are trying to work with commands that are going through the network director, it will fail.

Try running the Schedule Service under your logon and see if it doesn’t magically work.

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several