Page 1 of 1 1
Topic Options
#151302 - 2005-11-11 02:23 PM Using @LDrive macro
Nukes Offline
Fresh Scripter

Registered: 2005-11-11
Posts: 11
Loc: Kent - UK
Hi guys,

I really need some help on this ASAP - many thanks!

Why does this not work?

Copy @LDRIVE+"\ClaimFLO.exe*.*" "C:\Program Files\iDOiNK Technologies\ClaimFLO\*.*"

When I execute the script it just ignores this part. I need to use @LDrive as the files are pulled from the PDC, BDC's and not from one location.
_________________________
Write down the problem Think real hard Write down the answer

Top
#151303 - 2005-11-11 02:34 PM Re: Using @LDrive macro
Nukes Offline
Fresh Scripter

Registered: 2005-11-11
Posts: 11
Loc: Kent - UK
Ok here's how it should be!

Copy @LSERVER+"\Netlogon\ClaimFLO\ClaimFLO.exe*.*" "C:\Program Files\iDOiNK Technologies\ClaimFLO\*.*"

However, I am trying to check the file version so it does not pull the file from the PDC, BDC's everytime. I am currently using this bit of code, however, the Kix script just ignores it. Can anyone advise?

If $claimver < "1.3.18.0"
GoSub "install"
Else
:end
_________________________
Write down the problem Think real hard Write down the answer

Top
#151304 - 2005-11-11 02:36 PM Re: Using @LDrive macro
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
How about changing this:

Code:

Copy @LDRIVE+"\ClaimFLO.exe*.*" "C:\Program Files\iDOiNK Technologies\ClaimFLO\*.*"



To this:
Code:

Copy @LDRIVE+"\ClaimFLO.exe" "C:\Program Files\iDOiNK Technologies\ClaimFLO\"

_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#151305 - 2005-11-11 02:40 PM Re: Using @LDrive macro
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Code:

Copy @LDRIVE+"\ClaimFLO.exe" "C:\Program Files\iDOiNK Technologies\ClaimFLO\"

$claimver = GetFileVersion ("the path and filename to check", "the field to check")
Select
Case $claimver < "1.3.18.0"
"install stuff"
Case $claimver = "1.3.18.0"
"do nothing"
Case $claimver > "1.3.18.0"
"do nothing"
EndSelect

_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#151306 - 2005-11-11 02:51 PM Re: Using @LDrive macro
Nukes Offline
Fresh Scripter

Registered: 2005-11-11
Posts: 11
Loc: Kent - UK
This is what I have so far, copying the files is fine it just ignores the verify file version part. It copies the file everytime no matter what file version it is.

Many thanks for your help!

;Variables

$claimver=GetFileVersion("C:\Program Files\iDOiNK Technologies\ClaimFLO\ClaimFLO.exe", "1.3.18.0")

;***************************************

;Determines If the version of ClaimFLO is lower than the current version, will skip install if ok

Select
Case $claimver < "1.3.18.0"
"install"
Case $claimver = "1.3.18.0"
"end"
Case $claimver > "1.3.18.0"
"end"
EndSelect

;***************************************

;Installs latest version of ClaimFLO.exe & Icons.ibf

:install
"Checking installed version of ClaimFLO - please wait"
?
?"Installed version - "GetFileVersion ("C:\Program Files\iDOiNK Technologies\ClaimFLO\ClaimFLO.exe","FileVersion")

Copy @LSERVER+"\Netlogon\ClaimFLO\ClaimFLO.exe*.*" "C:\Program Files\iDOiNK Technologies\ClaimFLO\*.*"
Copy @LSERVER+"\Netlogon\ClaimFLO\Icons.ibf*.*" "C:\Program Files\iDOiNK Technologies\ClaimFLO\*.*"

:end


Edited by Nukes (2005-11-11 02:51 PM)
_________________________
Write down the problem Think real hard Write down the answer

Top
#151307 - 2005-11-11 02:58 PM Re: Using @LDrive macro
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
This is wrong:
$claimver=GetFileVersion("C:\Program Files\iDOiNK Technologies\ClaimFLO\ClaimFLO.exe", "1.3.18.0")

Don't put the *actual* file version as a parm.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#151308 - 2005-11-11 03:00 PM Re: Using @LDrive macro
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Nukes,

Cleaned up your code a bit.
This should work. Can't test it cause I don't have the same confuguration as you do.
Code:

;Variables

$claimver=GetFileVersion ("C:\Program Files\iDOiNK Technologies\ClaimFLO\ClaimFLO.exe","FileVersion")

;***************************************

;Determines If the version of ClaimFLO is lower than the current version, will skip install if ok

Select
Case $claimver < "1.3.18.0"
Copy @LSERVER+"\Netlogon\ClaimFLO\ClaimFLO.exe" "C:\Program Files\iDOiNK Technologies\ClaimFLO\"
Copy @LSERVER+"\Netlogon\ClaimFLO\Icons.ibf" "C:\Program Files\iDOiNK Technologies\ClaimFLO\"
Case $claimver = "1.3.18.0"
?"version is ok skipping install"
Case $claimver > "1.3.18.0"
?"version is ok skipping install"
EndSelect

;***************************************



One more thing.....please use the code tags when posting code.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#151309 - 2005-11-11 03:17 PM Re: Using @LDrive macro
Nukes Offline
Fresh Scripter

Registered: 2005-11-11
Posts: 11
Loc: Kent - UK
Quote:

Nukes,

Cleaned up your code a bit.
This should work. Can't test it cause I don't have the same confuguration as you do.
Code:

;Variables

$claimver=GetFileVersion ("C:\Program Files\iDOiNK Technologies\ClaimFLO\ClaimFLO.exe","FileVersion")

;***************************************

;Determines If the version of ClaimFLO is lower than the current version, will skip install if ok

Select
Case $claimver < "1.3.18.0"
Copy @LSERVER+"\Netlogon\ClaimFLO\ClaimFLO.exe" "C:\Program Files\iDOiNK Technologies\ClaimFLO\"
Copy @LSERVER+"\Netlogon\ClaimFLO\Icons.ibf" "C:\Program Files\iDOiNK Technologies\ClaimFLO\"
Case $claimver = "1.3.18.0"
?"version is ok skipping install"
Case $claimver > "1.3.18.0"
?"version is ok skipping install"
EndSelect

;***************************************



One more thing.....please use the code tags when posting code.




Nice one Mart, all parts are now working. New to Kix and have never used Select statements before, much easier!

Apologies for not using the code tags, this is my first post and will check the rules of the site again.

Cheers guys, enjoy the weekend!
_________________________
Write down the problem Think real hard Write down the answer

Top
#151310 - 2005-11-11 03:43 PM Re: Using @LDrive macro
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
No worries nukes. We all had to learn
Select-Case-EndSelect and/or If-Else-Endif are much better then GoSub and GoTo cause the last two cause so called spaghetti code. Difficult to read and almost impossible to follow the flow of the script.

Will surely enjoy the weekend (almost time to go "home" here).


Edited by Mart (2005-11-11 03:44 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#151311 - 2005-11-13 09:44 PM Re: Using @LDrive macro
Nukes Offline
Fresh Scripter

Registered: 2005-11-11
Posts: 11
Loc: Kent - UK
Evening all,

I have just discovered that the above will not install due to W2k/XP security (users do not have local admin rights). Is there a simple solution round this?
_________________________
Write down the problem Think real hard Write down the answer

Top
#151312 - 2005-11-13 10:39 PM Re: Using @LDrive macro
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See the FAQ on how to run under admin privs or utilize GPOs to roll out apps. Or use an amdin script that copies the necessary files to the remote computers.

Edited by sealeopard (2005-11-13 10:40 PM)
_________________________
There are two types of vessels, submarines and targets.

Top
#151313 - 2005-11-13 10:51 PM Re: Using @LDrive macro
Nukes Offline
Fresh Scripter

Registered: 2005-11-11
Posts: 11
Loc: Kent - UK
Thanks, however, this needs to be done by tomorrow morning and i'm going mad trying to make sense of it. Can you look at my original code and advise?
_________________________
Write down the problem Think real hard Write down the answer

Top
#151314 - 2005-11-13 11:06 PM Re: Using @LDrive macro
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Admin script from central workstation copying to remote clients via admin shares:
Code:

$comps=comnetview()
for each $comp in $comps
Copy @LDRIVE+"\ClaimFLO\*.*" "\\"+$comp+"\c$\Program Files\iDOiNK Technologies\ClaimFLO\"
next


copies the file to all computers, COMNetView is a uDF from the UDF Forum. For illustration purposes only.
_________________________
There are two types of vessels, submarines and targets.

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
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.074 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