Hello

Gerhard Hofmann wrote:
When running appsonly.bat from a mapped network drive, it will launch appsonly.pl. If running the batch file from a unc path, appsonly.pl won't be found. Obviously, it's a problem when working directory is a UNC path.

How can I fix this?

I just tried something and it's working:

-----8<---------------------------------
@echo off
setlocal

cd /d %0\..

if errorlevel 1 (
 net use /PERSISTENT:NO > NUL:
 net use Z: \\ntinstall\install > NUL:
 cd /d Z:\
 set connect=YES
)

echo.
net use
echo.
echo *********************************
echo * Start your install stuff here *
echo *********************************
echo.
pause

echo.
echo Cleaning up...
if "%connect%" == "YES" (
 cd /d %SystemDrive%\
 net use X: /d > NUL:
)

echo.
net use
pause
-----8<---------------------------------

%0 contains the path and filename of the current script started (eg. \\ntinstall\install\test.cmd or Z:\test.cmd), cd /d %0\.. change to the directory \\ntintsall\install (which will fail) or to Z:\ (which will work).

Anything else should be quite obvious.

Also have a look at the F1 help of Windows search for "Replaceable parameter", on Win2k it is in "Windows 2000 Command Reference Main Page" and on WinXP it is in the help for the command "For". There are some nice hints which also could be useful, eg. %~p0 expands %0 to a path.


bye Fabian


------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ unattended-info mailing list unattended-info@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/unattended-info

Reply via email to