Page 1 of 1 1
Topic Options
#133763 - 2005-02-14 11:19 PM Cannot create another system semaphore error
brewdude6 Offline
Hey THIS is FUN

Registered: 2000-10-21
Posts: 280
Loc: Nashville, TN
Any idea why I would get this error using this code below?

Code:
  
$mydocuments=ReadValue("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Personal")
$cmd='$installfolder\xxcopy "'+$mydocuments+'" "'+$udocuments+'" /bi /s /yy /oa$uxxcopylog'
? 'Executing : '+$cmd
Shell '%COMSPEC% /c '+$cmd
If @error <>0
$writelog = WriteLog2($logfile,"@USERID on @WKSTA with @serror My Documents Copy",1)
EndIf

_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain

Top
#133764 - 2005-02-15 12:56 AM Re: Cannot create another system semaphore error
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Don't use variables inside strings, check the $cmd variable to make sure it's correct and @error does not refer to the SHELL command but to READVALUE as SHELL doesn't set the @error.
_________________________
There are two types of vessels, submarines and targets.

Top
#133765 - 2005-02-15 01:11 AM Re: Cannot create another system semaphore error
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
jens,

shell not setting the @error is not true.

Code:
$site = "Fu.bar"
shell '%comspec% /c ping -n 1 ' + $site + ' > nul'
if @error
? "Unable to ping " + $site
else
? $site + " is up"
endif



Also, while using variables inside a string is frowned upon it is valid kix code unless one uses the "NoVarInString" option.

Double check your xxcopy syntax, I think your problem is in there.


Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 363 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.062 seconds in which 0.033 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org