Jump to content

Recommended Posts

Posted

I am currently using an unattend process using the old method of batch files. This process is working very well for me so I don't want to change to one of the newer methods that are listed. The current process has a total of 6 batch files, one is called by cmdlines.txt and the remainder are part of the [GuiRunOnce]. Batch files as follows:

[cmdlines.txt]

0PreGui.bat

[GuiRunOnce]

1applications.cmd

2main_batch.cmd

3additionalsettings.cmd

4cleanup.cmd

delete.bat

This works great but when changes are required I must update 7 different server builds. So what I did was created a folder structure for each network. Placed all network specific settings into appropriate subfolder. I then created a menu batch file called 3networksettings.bat and replaced 3additionalsettings.cmd in the GuiRunOnce.

During the unattended installation it brings up 3networksettings.bat but when I select the approprite network it says n1.bat is unrecognized. All other options state the same error. I can run the batch (3networksetting.bat) without issue outside of the unattend process. When I quit 3networksettings.bat via menu choice 8 it moves to the next file in the [GuiRunOnce]

Any help would be greatly appreciated.

TIA

Murph

(3networksettings.bat )

CLS
@echo off
Color 3f
title Choose Network
ECHO.
@ECHO OFF
:Start
SET MyInput=
IF NOT '%1'=='' GOTO QUIT_MENU
ECHO Select the corresponding number for server you want to build!!.
ECHO 1. Network1
ECHO 2. Network2
ECHO 3. Network3
ECHO 4. Network4
ECHO 5. Network5
ECHO 6. Network6
ECHO 7. Network7
ECHO - - - - -
ECHO 8. Quit
SET /P Input=Please choose an option:
IF %Input% == 8 GOTO QUIT
IF %Input% == 7 GOTO Network7
IF %Input% == 6 GOTO Network6
IF %Input% == 5 GOTO Network5
IF %Input% == 4 GOTO Network4
IF %Input% == 3 GOTO Network3
IF %Input% == 2 GOTO Network2
IF %Input% == 1 GOTO Network1
:Network7
n7.bat
GOTO Start
:Network6
n6.bat
GOTO Start
:Network5
n5.bat
GOTO Start
:Network4
n4.bat
GOTO Start
:Network3
n3.bat
GOTO Start
:Network2
n2.bat
GOTO Start
:Network1
n1.bat
GOTO Start
:QUIT_MENU
Exit


Posted

Try using

CALL n1.bat

Also please try to use CMD extensions for scripts intended for use with the Windows NT command interpreter.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...