WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: mjwillyone on January 09, 2014, 11:24:39 AM

Title: Windows8 and FileCopy
Post by: mjwillyone on January 09, 2014, 11:24:39 AM
Friends,

I have used Winbatch routine for years that simply copies files from our LAN server to the local machines every time the local machine is turned on.  The filecopy command is used.  This routine has worked flawlessly .. until we got new Windows 8 Professional computers.  I have checked to be sure that the user is set up as an administrator on the new computer.  All is well there.

However, I get the error as seen in the attached image.

Any ideas?

Mike
Title: Re: Windows8 and FileCopy
Post by: Deana on January 09, 2014, 11:44:06 AM
The screen shot seems to indicate you are trying to copy a file a mapped drive. This can cause issues when running on a system with UAC enabled ( Windows Vista or newer ).

When running as an Administrator, the user has two contexts: the limited user context, and the administrator context. When you map drives in Windows Explorer, they are added only for the limited user context. Thus when the script runs in the administrative context, no mapped drives are 'seen' by the script. WBT files run with user elevation 'HighestAvilable', which means when running under an Administrator account the script is running in the context of the administrator NOT the user. 

Instead of using a mapped drive, I recommend referencing the remote server using a UNC path (i.e. \\SERVER\SHARE\Filename.ext).

Other possible options:

Reference: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/UAC+Mapped~Drives~Issue~with~UAC.txt
Title: Re: Windows8 and FileCopy
Post by: mjwillyone on January 13, 2014, 09:06:52 AM
Thank you very much!!   Good news that there are ways around this!

Mike
Title: Re: Windows8 and FileCopy
Post by: Deana on January 13, 2014, 09:26:20 AM
Yes. My personal preference is to always use UNC paths to get around this type of issue.