[wpkg-users] Questions about offline mode and executing the wpkg service

Rainer Meier r.meier at wpkg.org
Thu Apr 3 20:18:31 CEST 2008


Hi Tomasz,

Tomasz Chmielewski wrote:
> Didn't you just describe one problem in this thread? :)

I use WPKG within VMWare, Virtual-PC and VirtualBox without problems 
yet. However I do not use the logon delay feature. What I noticed is 
that VMWare sometimes is extremely slow when handing out DHCP adresses. 
This might cause a problem with the WPKG service. Probably also an issue 
with the VMWare tools which are started _after_ WPKG service.

However I just use it for testing purposes and usually I run WPKG 
service from the services MMC snap-in to test what is happening.


> I have no idea. A bug? Which doesn't show up on real machines, though, 
> which is either good or bad.

Sure? I thought that Bug 106 is reporting a problem where WPKG service 
seems to wait for the maximum logon delay. Probably there is really an 
issue. If I have some spare time I will try to verify it on my VMWare.


>>   @echo off
>>   ping -n 1 <IP of server> >NUL
>>   exit /b %errorlevel%
>>
>> This script returns 0 if the server is reachable and 1 if not. I've tested 
>> this on the command line.
> 
> The script is rather simple and primitive, but already contains an error 
> ;) - it won't work with /b switch.
> Although this script will exit with non-zero code, /b prevents closing 
> of cmd.exe. A while later cmd.exe exits with code 0, and...

No. The 'exit /b %errorlevel%' is entirely correct. See 'exit /?'. On my 
Vista it reads:

[...]
   /B          specifies to exit the current batch script instead of
               CMD.EXE.  If executed from outside a batch script, it
               will quit CMD.EXE
[...]

So when using exit /b within a script you can exit a script with a 
certain exit code (%errorlevel% inserts the exit code of the immediate 
previous command). When /b is not used, then exit will not only exit the 
current script but terminate the whole CMD.EXE process. Which means that 
if you run exit within a script invoked by another one ('call 
script.cmd') it will never return and continue in the calling script but 
terminate completely. If 'exit /b <code>' is used, it will terminate the 
called script returning the specified code.

br,
Rainer



More information about the wpkg-users mailing list