1.

Solve : Need assistance modifying a script..... PLEASE...?

Answer»

Here is the script below... I want this script to automatically run as a user instead of choosing user or admin. Can anyone assist me with this please? THANK you...



@ECHO off
if "%2"=="" GOTO ERROR1_PARM
set InstType=Invalid
if /I "%2"=="U" set InstType=User
if /I "%2"=="A" set InstType=Admin
if "%InstType%"=="Invalid" goto ERROR1_PARM

TITLE COGNOS Impromptu v7.1 MR1 %InstType% Installation
cls
rem
rem As this procedure was designed to be run from the
rem network login script, no prompting for user reponse
rem is required by this batch file.
rem
rem

cscript %1:\COGNOS\IMP71MR1.vbs //nologo %1 %2 %3
if errorlevel 1 goto ERROR2_VBS
goto end
REM ===================================
:ERROR1_PARM
echo.
echo %0:
echo Error invalid/missing parameters
echo Drive letter of EPETUTIL directory
echo Installation type (U)ser or (A)dministrator.
echo.
echo Example:
echo %0 M A
echo.
PAUSE
goto end
rem
:ERROR2_VBS
echo.
echo %0: Error unable to execute Impromptu v7.1 MR1 installation script.
echo.
PAUSE
:END
It's not clear what parameters %1 and %3 should be as they are merely passed to the VBScript.

From the command line run as scriptname %1 U %3

%1 and %3 are placeholders for actual VALUES you send to the VBScript. You would know this better than me, although %1 appears to be a drive letter.

From another batch file you can run it the same way or use the call command:

call scriptname %1 U %3

Again, %1 and %3 are placeholder for values.

Passing U as the second parameter will set InstType to User.



Discussion

No Comment Found