your shell line will work 90% of time.
to make it 100%, I would still urge you to use:
 Code:
shell '%comspec% /c your_commandline_what_ever_it_might_be'


I have not run into it in a long time (maybe because by habit I always use comspec?) but in theory you could have issues of cmd.exe not reside in the path.

that is just cutting hairs now though, in the ages on win9x and win3.x it mattered more.

oh, and if you don't want your script to output 0 or 1 on the console, you can prepend your FUNCTION calls with simple $notcare=

so, for addprinterconnection() you would say:
 Code:
$IdontCare=addprinterconnection('\\server\share')


now, if you do care, you could do:
 Code:
$IdoCare=addprinterconnection('\\server\SHARE')
if $IdoCare
  'I could not connect you to SHARE printer. complain to your admin, he might care about: ' @serror ?
endif

_________________________
!

download KiXnet