User Input -> Update File -> Run Command using updated file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
dannyproc
Posts: 4
Joined: 05 May 2022 04:10

User Input -> Update File -> Run Command using updated file

#1 Post by dannyproc » 23 May 2022 11:30

Good Evening Guys

I have a slightly complicated request for help. i am trying to automate a process for engineers in work to format the Nand/Flash on HP servers (i work with refurb hardware).

Basically, this is an XML file (Force_Format.xml) that is used to format the NAND:

<!-- Firmware support information for this script: -->
<!-- iLO 4 - Version 2.42 or later. -->
<!-- iLO 3 - None. -->
<!-- iLO 2 - None. -->

<RIBCL VERSION="2.0">
<LOGIN USER_LOGIN="Administrator" PASSWORD="password">
<RIB_INFO MODE="write">
<FORCE_FORMAT VALUE="all" />
</RIB_INFO>
</LOGIN>
</RIBCL>

...................and this is the command run in a command prompt to execute the above XML: "hpqlocfg -s 192.170.1.40 -n -v -f c:\Force_Format.xml" (where "hpqlocfg" is the app that is called, the IP address of the unit, the arguments and then the file). The idea is, you update the XML with the login/password and save it, then run the command to execute the XML on the unit at the given IP address.

I'm looking to create some sort of batch that runs the following process:
1. creates copy of "master" xml file
2. asks user for IP address
3. asks user for login
4. adds user 'login' input instead of "Administrator" in the copied XML file
5. asks user for password
6. adds user 'password' input instead of "password" in the copied XML file
7. runs the ""hpqlocfg -s 192.170.1.40 -n -v -f c:\Force_Format.xml" but with the user replaced IP address
8. deletes copied xml file

is that even remotely possible? because right now, my complete lack of skill set here has me writing standard processes instructing them how to do it by hand themselves!!!!

thanks in advance for any advice

batmanbatmanbatmen
Posts: 9
Joined: 23 Sep 2022 22:13

Re: User Input -> Update File -> Run Command using updated file

#2 Post by batmanbatmanbatmen » 24 Sep 2022 04:00

Not too understand your process. But suggest:

if you want create a script that run at user's computer:

1. asks user for IP address <-- can get by script. No need ask user.
2. asks user for login <--- prompt user input at script
3. asks user for password <---- prompt user input at script

4. creates copy of "master" xml file
5. adds user 'login' input instead of "Administrator" in the copied XML file
6. adds user 'password' input instead of "password" in the copied XML file

7. runs the ""hpqlocfg -s 192.170.1.40 -n -v -f c:\Force_Format.xml" but with the user replaced IP address
8. deletes copied xml file

If the script run at user computer, it will use user's computer cpu/ram power. It also make sure user have access right on it.

Post Reply