Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
djangofan
- Posts: 23
- Joined: 04 Nov 2011 12:28
#1
Post
by djangofan » 17 Jan 2012 13:31
Is it possible to run a batch file from a network share location?
For example, I have this script:
And it results in output that looks like this:
Code: Select all
'\\demo.mysite.com\c$\SharedFiles\Batch'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
Hello World
Press any key to continue . . .
-
Ed Dyreen
- Expert
- Posts: 1569
- Joined: 16 May 2011 08:21
- Location: Flanders(Belgium)
-
Contact:
#2
Post
by Ed Dyreen » 17 Jan 2012 13:35
'
You are already doing it
-
djangofan
- Posts: 23
- Joined: 04 Nov 2011 12:28
#3
Post
by djangofan » 17 Jan 2012 14:32
Ed Dyreen wrote:'
You are already doing it
I don't think so. If I go into a any more complex example, such as using COPY.exe, then it fails to copy with a similar error. Therefore, I am wondering what the secret is, as I currently do not believe it is possible.
-
Ed Dyreen
- Expert
- Posts: 1569
- Joined: 16 May 2011 08:21
- Location: Flanders(Belgium)
-
Contact:
#4
Post
by Ed Dyreen » 17 Jan 2012 14:44
'
Try DOSKIT (XP 32bit OS), to see a working example, I develop it and can be installed from UNC path:
viewtopic.php?f=3&t=1893You should go local as soon as possible, even if it were only for performance related issues.
-
Squashman
- Expert
- Posts: 4486
- Joined: 23 Dec 2011 13:59
#5
Post
by Squashman » 19 Jan 2012 07:46
Food for thought
Code: Select all
@echo off
SET MyDIR=%~dp0
echo %MyDIR%
pushd %MyDIR%
echo %CD%
pause
Last edited by
Squashman on 19 Jan 2012 07:54, edited 1 time in total.
-
Squashman
- Expert
- Posts: 4486
- Joined: 23 Dec 2011 13:59
#6
Post
by Squashman » 19 Jan 2012 07:49
djangofan wrote:I don't think so. If I go into a any more complex example, such as using COPY.exe, then it fails to copy with a similar error. Therefore, I am wondering what the secret is, as I currently do not believe it is possible.
xcopy supports UNC paths.