VMware {code} Community
Seelenmagnet
Contributor
Contributor

Problems with CustomizationSpec - CustomizationGuiRunOnce

Hi there,

I'm having Problems using the CustomizationGuiRunOnce.

I'm piecing together a CustomizationSpecItem using the Perl-API and then initiate a Clone with said Spec.

While the whole Setup is working as intended, the commands in the list are not running proberly.

I fill the commandList with the following code: (the commandList is encapsulated in square bracktes instead of '{' and '}')

guiRunOnce => CustomizationGuiRunOnce->new(
commandList => {
'net use q:

<Server>\Scriptchain <Password>/User:<Domain>\Administrator',
'cmd /C "md %SYSTEMDRIVE%\teeest" ',
'cmd /C "xcopy q:. %SYSTEMDRIVE%\teeest /E" ',
'cmd /C "%SYSTEMDRIVE%\teeest\start.vbs"
}
),

Setup like this you just don't see any result.

If I change the '/C' to a '/K' (meaning he should keep the command prompt open after finishing the provided command), 3 command prompt windows open at the start of the system like they should do, but you can clearly see that no files are getting copied and a folder isn't created neither.

I inserted a line to save the CustomizationSpecItem in the VC to check what is writen in the commandList.

Following lines are saved in that Spec:

net use q:
<Server>\Scriptchain <Password> /User:<Domain>\Administrator
cmd /C "md %SYSTEMDRIVE%\teeest"
cmd /C "xcopy q:. %SYSTEMDRIVE%\teeest /E"
cmd /C "%SYSTEMDRIVE%\teeest\start.vbs"

I copied those lines into the RunOnce-Key of the windows-registry and it workes as intended.

I looked through the Forum but couldn't find a helpfull answer to my problem.

Please tell me what I'm doing wrong.

0 Kudos
3 Replies
StefanPahrmann

Hi,

I've tried something similiar and used lots of time to figure things out. It seems that the commands don't accept spaces or arguments eg. "runapp.exe arg1" doesn't work. "Runapp.bat" does in contrary work.

An other issue is, that after deploying and running sysprep and windows is coming up first time (and you're logged on), there is a vbs-script which configures the nic with the right IP-setting. This can take som minutes.If you're running your script, which want to connect to a server, it will fail (simply because the tcp-settings aren't set yet).

-Stefan

Seelenmagnet
Contributor
Contributor

While it's true that a workround like that (putting all commands in a .bat) would solve that problem, it's kind of a strange behavior.

The /C (or /K) Argument of cmd is correctly interpreted, why isn't the same true with the other parameters.

Isn't sysprep supposed to use the RunOnce-key of the registry?

I wouldn't really like to deploy a .bat/.vbs in every template...

0 Kudos
Seelenmagnet
Contributor
Contributor

Just to inform everyone who had suffered from the same problem; I tested the behaviour with VirtualCenter 2.5.0 and it works like a charm.

(*it *being the RunOnce-commands with parameters)

0 Kudos