ShaneEP
(MM club member)
2003-01-14 11:27 PM
Copy GUI UDF Problem?

I am running the following...It works great on a Windows XP Pro pc but errors out on a Windows 2000 Pro pc.

code:
 
IF EXIST ("D:\Build\*.*")
GUICopy("D:\Build\Temp", "%systemdrive%", 528)
GUICopy("D:\Build\SP3", "%systemdrive%", 528)
ENDIF

function GUICopy($Source, $Destination, $Flags)
$objShell=CreateObject("Shell.Application")
$objFolder=$objShell.NameSpace($Destination)
$objFolder.CopyHere($Source, $Flags)
$objShell=0
endfunction


I get an error that says...

Script error: expected expression!
$objFolder.CopyHere($Source, $Flags)


ShaneEP
(MM club member)
2003-01-14 11:31 PM
Re: Copy GUI UDF Problem?

Nevermind...Just me being stupid again... [Confused]

ShaneEP
(MM club member)
2003-01-14 11:32 PM
Re: Copy GUI UDF Problem?

Forgot to add the "\" after %systemdrive%. I guess XP was just smart enough to figure it out.

code:
 
IF EXIST ("D:\Build\*.*")
GUICopy("D:\Build\Temp", "%systemdrive%\", 528)
GUICopy("D:\Build\SP3", "%systemdrive%\", 528)
ENDIF

function GUICopy($Source, $Destination, $Flags)
$objShell=CreateObject("Shell.Application")
$objFolder=$objShell.NameSpace($Destination)
$objFolder.CopyHere($Source, $Flags)
$objShell=0
endfunction



LonkeroAdministrator
(KiX Master Guru)
2003-01-14 11:34 PM
Re: Copy GUI UDF Problem?

are you sure that xp doesn't already have it there?

ShaneEP
(MM club member)
2003-01-14 11:57 PM
Re: Copy GUI UDF Problem?

%systemdrive% = F: on both machines. The files were also not on the XP machine. But aslong as it works...I dont care how many \'s I have to add.

Chris S.
(MM club member)
2003-01-15 03:30 AM
Re: Copy GUI UDF Problem?

If you'd have left my error checking lines in there it would have told you the problem. [Wink] [Wink] [Wink]

LonkeroAdministrator
(KiX Master Guru)
2003-01-15 04:21 AM
Re: Copy GUI UDF Problem?

chris, you should have done more exchaustive error checking...
some sort of check if the udf was changed [Wink]


JochenAdministrator
(KiX Supporter)
2003-01-15 08:24 AM
Re: Copy GUI UDF Problem?

Yeah ... build another CheckSum() UDF to check other udfs for changes ... LOL

LonkeroAdministrator
(KiX Master Guru)
2003-01-15 08:27 AM
Re: Copy GUI UDF Problem?

I was thinking more like a internal checker...
first check all the conditions how it returns and does it show errors correctly and if ok, start the actual task.

anyway, once ppl learn to make cryptic enough udfs, there is no need for such checks, right? [Wink]


Radimus
(KiX Supporter)
2003-01-16 12:48 AM
Re: Copy GUI UDF Problem?

have everyone write their UDFs, then have them golfed... after that no one can understand them and they will be left alone... [Big Grin]

LonkeroAdministrator
(KiX Master Guru)
2003-01-16 12:55 AM
Re: Copy GUI UDF Problem?

I wonder which of my UDFs don't stand in golf competition...
can't see any [Razz]


Radimus
(KiX Supporter)
2003-01-15 01:36 PM
Re: Copy GUI UDF Problem?

and I don't mess around inside your UDFs...

of course, I can't tell what they'd be used for either [Big Grin] [Big Grin] [Razz]


ShaneEP
(MM club member)
2003-01-15 11:32 PM
Re: Copy GUI UDF Problem?

Actually I had not changed the UDF until I was getting the error. Then I stripped it down to try find the problem.

[ 15. January 2003, 23:38: Message edited by: CitrixMan ]


ShaneEP
(MM club member)
2003-01-15 11:43 PM
Re: Copy GUI UDF Problem?

Maybe the "F:" passes the If Exist but still cant really copy to F:? Maybe should check that $Destination is also atleast 3 chars?

[ 15. January 2003, 23:48: Message edited by: CitrixMan ]


LonkeroAdministrator
(KiX Master Guru)
2003-01-16 07:51 AM
Re: Copy GUI UDF Problem?

that would sound pretty silly though...