Plz help..
I am trying to run a batch on another server to copy a file to not shared directory (not UNC):
bat1:
call "\\serv2\folder\bat2.bat"
bat2:
SET path01="\\serv01\deployment\serv02"
SET path02="d:\application\ui"
copy "%path01%\web.config" "%path02%\web.config"
I have tried %~dp0 but this only uses the shared folder directory and can only copy to that folder(not desired location)
I tried PUSHD but this also creates a local virtual directory so in this case is path01 and this only, where I am trying to copy a file to local path02 (serv02)
I know there is always a problem with reading UNC`s and I couldnt find an answer to this on stack. Is there a way to run bat02 as local but still pull path01? As a "double click" run on the bat2 is working fine and does the job.
Many thanks!
If you are an admin then everything is shared. The admin shares C$, D$, ..., N$ are admin hidden shares.
copy "\\serv01\C$\folder\file.ext" "\\serv02\C$\folder\file.ext"
There are also Print$ and Admin$ shares. Type net share
to see list.
To run a file remotely
wmic /node:serv02 process call create "cmd /c somefile.bat"