Avatar of Bogart Bogart
Bogart Bogart

asked on 

XCOPY or ROBOCOPY wont run in batch file

I have this old batch file that I used to upgrade a software and since it is time for another one I have tried creating a GPO and assigned it under User Configuration>Windows Settings>Logon.

But when testing with a user logging on the batch file wont run but when manually clicking the file it runs perfectly fine!

Here is the code:  xcopy "Source" "Destination" /S /C /I /H /R /Y

Users have a full time mapped drive from where the source file is copied to the local drive C:\Folder

Note that robocopy is the same and doesn't run automatically.
SoftwareMicrosoft DOSScripting Languages

Avatar of undefined
Last Comment
Bogart Bogart
SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Bogart Bogart
Bogart Bogart

ASKER

Hi NVIT, I just came back and revisited the still logged on user and I am seeing it happen just now and files are flying!

I don't know what's causing the delay?

My expectation was for the files to be copied and dos window to be up as soon as user is logged in.

Weird.
Avatar of NVIT
NVIT
Flag of United States of America image

Not sure on the delay cause. How long did you wait? Maybe try another user to time it.
Avatar of Bogart Bogart
Bogart Bogart

ASKER

Over 10 minutes which isn't really good. I will try with another user and will let you know.

It's a 3+Gb file and taking so long though. May have to try Robocopy as this could be a lot faster.

Otherwise will have to make this a logoff process.
Avatar of Bogart Bogart
Bogart Bogart

ASKER

Ni NVIT just logged in another test user and the batch file does work but it starts after 4 minutes of wait.

I am not sure where the delay is coming from
Avatar of Bogart Bogart
Bogart Bogart

ASKER

I am testing this on a Win8.1 and seems to be a policy setting set to a default of 5 minutes! Will test this on a Window 7 and see how I go.
ASKER CERTIFIED SOLUTION
Avatar of Bogart Bogart
Bogart Bogart

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of NVIT
NVIT
Flag of United States of America image

Awesome, Bogart!
I'm glad you figured it out.
Can you set it to 1 minute?
Avatar of Bogart Bogart
Bogart Bogart

ASKER

Hi NVIT from what I've read it can be set to whatever you like.
Avatar of NVIT
NVIT
Flag of United States of America image

1 is faster than 5. Hehe
Avatar of Bogart Bogart
Bogart Bogart

ASKER

Hah it is indeed!
Avatar of Bogart Bogart
Bogart Bogart

ASKER

This is know issue with 8.1 and is controlled in the mentioned GPO settings
Software
Software

Software is any set of instructions that directs a computer to perform specific tasks or operations. Computer software consists of programs, libraries and related non-executable data (such as documentation). Computer software is non-tangible, contrasted with computer hardware, which is the physical component of computers. Software written in a machine language is known as "machine code". However, in practice, software is usually written in high-level programming languages than machine language. High-level languages are translated into machine language using a compiler or interpreter or a combination of the two.

43K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo