I try to expand variable %TEMP% only with Path %~p but doesn't work, could you please help me.
Here my code:
Code: Select all
@echo off
setlocal EnableDelayedExpansion
rem My script will start from this path %SCRIPTS%
set ORIGIN=%~d0\Home
set SCRIPTS=%ORIGIN%\Scripts
set INPUT=%ORIGIN%\Input
set OUTPUT=%ORIGIN%\Output
set ENVELOPE=%ORIGIN%\Envelope
set TEMP=%ORIGIN%\Temp
rem My command must be like this, because I want in a zip file also a name of directory
7za a %OUTPUT%\filezip.7z temp\a.pdf Temp\a.txt
rem But if I run this script a variable %Temp% will be resolved as "C:\Home\Temp" and this is not good
rem I try to expand %Temp% as %~p%Temp% but return alway a syntax error
rem This is a result that I don't want
7za a %OUTPUT%\filezip.7z %Temp%\a.pdf %Temp%\a.txt
7za a C:\Home\Output\filezip.7z C:\Home\Output\Temp\a.pdf C:\Home\Output\Temp\a.txt
rem This is a command I want, and also this must be run from directory %ORIGIN%, because if I run into %SCRIPTS% doesn't work
7za a C:\Home\Output\filezip.7z Temp\a.pdf Temp\a.txt
Thanks in advance and regards