From 79215b4f17ab812124fda988f5e12a99959eaf58 Mon Sep 17 00:00:00 2001
From: Adam Thorn <alt36@cam.ac.uk>
Date: Fri, 28 Feb 2020 15:04:11 +0000
Subject: [PATCH] Update example script to adopt convention that the var names
 we set start with WPKG

NB you'll need to ensure you have defined WPKGSOFTWAREUSER and WPKGSOFTWAREPASSWORD
now when using the example wrapper script
---
 scripts/wpkg.cmd | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/wpkg.cmd b/scripts/wpkg.cmd
index 32b0c4a8..c1cf1f17 100755
--- a/scripts/wpkg.cmd
+++ b/scripts/wpkg.cmd
@@ -1,5 +1,4 @@
 @echo off
-set IFS=ifs.ch.private.cam.ac.uk
 set WPKG_REG=HKLM\Software\WPKG\vars
 
 ::WPKG variables defined in the registry as set per group policy.  Allows for per department variables to be defined
@@ -11,12 +10,13 @@ if /i "%WPKGJS%"=="" echo.The value of %%WPKGJS%% is blank, not allowed&exit /b
 if /i "%WPKGJS64%"=="" echo.The value of %%WPKGJS64%% is blank, not allowed&exit /b
 if /i "%WPKGINSTITUTION%"=="" echo.The value of %%WPKGINSTITUTION%% is blank, not allowed&exit /b
 if /i "%WPKGSOFTWARE%"=="" echo.The value of %%WPKGSOFTWARE%% is blank, not allowed&exit /b
+if /i "%WPKGSOFTWAREUSER%"=="" echo.The value of %%WPKGSOFTWAREUSER%% is blank, not allowed&exit /b
+if /i "%WPKGSOFTWAREPASSWORD%"=="" echo.The value of %%WPKGSOFTWAREPASSWORD%% is blank, not allowed&exit /b
 if /i "%WPKGLOGDIR%"=="" echo.The value of %%WPKGLOGDIR%% is blank, not allowed&exit /b
-if /i "%IFSNODE%"=="" echo.The value of %%WPKGLOGDIR%% is blank, not allowed&exit /b
 
 if NOT exist %WPKGLOGDIR% mkdir %WPKGLOGDIR%
 
-net use * \\%IFS%\deploy\software /user:deploy-share-reader@ad.ch.cam.ac.uk %IFSNODE% >nul 2>&1
+net use * %WPKGSOFTWARE% /user:%WPKGSOFTWAREUSER% %WPKGSOFTWAREPASSWORD% >nul 2>&1
 
 if exist "%programfiles(x86)%" (goto 64bit) else (goto 32bit)
 
@@ -33,8 +33,8 @@ cscript  //E:jscript  //nologo %WPKGJS64% %*
 goto end
 
 :end
-::remove the IFS share
-FOR /F "tokens=2" %%D IN ('net use ^| find "%IFS%"') DO net use %%D /d >nul 2>&1
+::remove the WPKGSOFTWARE share
+FOR /F "tokens=2" %%D IN ('net use ^| find "%WPKGSOFTWARE%"') DO net use %%D /d >nul 2>&1
 
 ::clear the variables set at the top of this scripts
 for /f "tokens=1,2,3" %%a in ('reg query %WPKG_REG%') do (
-- 
GitLab