My company has a software that updates our installers on clients' servers. During the setup, a environment variable is created along with a task with the following lines:
Variable:
setx ccloud "C:\Capela\CCloud" /M
Obs.: the path used is the "install path" defined during the setup.
Task:
schtasks.exe /Create /RU SYSTEM /SC DAILY /TN CCloudUpdater /TR "cmd.exe /C C:\Capela\CCloud\ccloud-updater.bat" /ST 02:00 /F >
The bat file has the following arguments:
@echo off
cd /d "%CCLOUD%"
ccloud.exe cache -c
ccloud.exe logs -c
ccloud.exe installers -d ccloud --w
if exist "installers\ccloud\ccloud-setup.exe" (
START /WAIT "CCloud Setup" "installers\ccloud\ccloud-setup.exe" /S
)
ccloud.exe auto -t -i -s
timeout 60 > nul
ccloud.exe auto -t -i -s
timeout 900 > nul
ccloud.exe auto -t -i -s
After running it, our softwares and services are downloaded and extracted to a folder. The packages are defined by an online manager.
However, there is ONE server (2k8R2, just like many others) that just can't read the variable, no matter what we do. The task runs as intended, but since the variable is somehow unavailable, it can't download the packages.
We tried using
echo "%ccloud%" > path.txt
inside the bat, the TXT returns only "" like that variable is undefined.
We don't know what else to do. Can anyone help me find out what's happening?
cd /d %~dpn0
should work.setx
command doesn't work reliably, by the way. Not sure from your description whether or not that might be your problem, but FYI.