I am running a Powershell script from a bat file. These 2 files are placed on a network server and I am trying to run these on network server from my machine by accessing network server folder. I get following error:
CMD doesn't support UNC paths as current directories.
When I execute bat file , it tries to read script file from path
C:\Windows\System32
not from current directory which is set in bat file.
This script and bat file work fine when I run on my local machine.
I tried finding this on Google and possible solutions need to change some settings on network server which is not possible in my case.
What could be possible solution for this?
I am using PowerShell 2.0
Here is my bat file to run Powershell script
setlocal & pushd .
:getting current directory
cd /d %~dp0
Powershell.exe Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
Powershell.exe . '%CD%\Hotfix-Automation-Installer.ps1' crpt
exit /B