[wpkg-users] [OT] i hate script in cmd... ;(((

Malte Starostik lists at malte.homeip.net
Tue Feb 14 23:30:43 CET 2012


Hi Marco,

Am Dienstag, 14. Februar 2012, 22:52:08 schrieb Marco Gaiarin:
> I've wrote down a script/helper to add me in the task of adding some
> domain group to some local group, wrapping around 'net localgroup'.
> Script attached.
> 
> The script, on console, from SYSTEM user (the same that run wpkg) seems
> to work well: check, add and remove membership correctly.
> 
> Used inside wpkg recipe (on action and check condition) behave
> strangely.

I'm really just guessing, but looking at your script I see you're using "find".  
I've *never* got find/findstr to work from within scripts launched by wpkg, I 
assume it's somehow very pickety about its standard file handles and barfs on 
the pipes WSH gives it.
Maybe, just maybe you can get it to work if you wrap up execution of your CMD 
script to be called from another JS/VBS script via WScript.Shell.Run instead 
of WshExec.  But then…once you possibly consider using WSH instead of CMD, you 
might just stick with it.  The group manipulations you need could probably be 
achieved quite well with your WSH language of choice via WBEM.
As another alternative, maybe Powershell could be an option for you.  Or Perl 
should you have that installed anyway. 

Even Assembler might be easier than getting CMD working right in some cases 
without causing permanent damange to one's brain ;)
 
Best of luck,
Malte




More information about the wpkg-users mailing list