Page 1 of 1 1
Topic Options
#115571 - 2004-03-05 04:51 PM Help, getting really confued! :-(
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
Hey, can anyboy tell me why the "dell" part of the script is not working? The "comapq" and "hp" part works well, but i cannot get "dell" part to work, it just stops at the url, while it should use the $setag value and go on to next page.


$vendor = PC vendor
$setag = PC Serial no

Function Vensupp
Select
Case InStr($vendor,'dell') $url = 'http://support.euro.dell.com/uk/en/index.asp?referrer=%2Fuk%2Fen%2Fhome%2Easp&segment=BSD'+Join($setag,"+")
Case InStr($vendor,'compaq') $url = 'http://productfinder.support.hp.com/tps/ProductFinder?h_query='+Join(Split($model),'+')
Case InStr($vendor,'Hewlett-Packard') $url = 'http://productfinder.support.hp.com/tps/ProductFinder?h_query='+Join(Split($model),'+')
Case 1 $url = ''
EndSelect
If $url
Run 'cmd /c start '+$url
EndIf
EndFunction

C the


Edited by Cyrus (2004-03-05 04:53 PM)
_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#115572 - 2004-03-05 05:00 PM Re: Help, getting really confued! :-(
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
The "%" characters may be expanded to environment variables, and the "&" may also cause confusion.

A much simpler and cleaner solution is to start IE via COM automation, and use the "navigate" method to open the page.

This will avoid all the possible issues with meta-characters.

Top
#115573 - 2004-03-05 05:05 PM Re: Help, getting really confued! :-(
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
double up the % and & characters...

Edited by Radimus (2004-03-05 05:06 PM)
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#115574 - 2004-03-05 05:08 PM Re: Help, getting really confued! :-(
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
BTW... have you tried:
'https://support.dell.com/ProductSelection.aspx?SvcTag='+$serno
'http://productfinder.support.hp.com/tps/ProductFinder?h_query='+join(split($model),'+')
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#115575 - 2004-03-05 05:28 PM Re: Help, getting really confued! :-(
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
Richard can u give me an example how to use COM automation and navigate metod?
_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#115576 - 2004-03-05 05:28 PM Re: Help, getting really confued! :-(
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Code:
Function Vensupp($model,$setag) 
Select
Case InStr($vendor,'dell')
$url = 'http://support.euro.dell.com/uk/en/index.asp?referrer=%2Fuk%2Fen%2Fhome%2Easp&segment=BSD'+Join($setag,"+")
Case InStr($vendor,'compaq')
$url = 'http://productfinder.support.hp.com/tps/ProductFinder?h_query='+Join(Split($model),'+')
Case InStr($vendor,'Hewlett-Packard')
$url = 'http://productfinder.support.hp.com/tps/ProductFinder?h_query='+Join(Split($model),'+')
Case "True"
$url = ''
EndSelect
If $url
; Create Internet Explorer object
$oIE = CreateObject("InternetExplorer.Application")
$oIE.Visible=1
$oIE.Navigate($url)
; Wait for page to stop loading...
While $oIE.busy AND $oIE.readystate <> 4 AND @ERROR = 0 Loop
EndIf
EndFunction


Top
#115577 - 2004-03-05 05:47 PM Re: Help, getting really confued! :-(
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
Thanx, but its not working :-( gives me "invalid method/function call: missing required parameter 1"

Have to check whats going on....
_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#115578 - 2004-03-05 05:50 PM Re: Help, getting really confued! :-(
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
double up the % and & characters... kix requires that
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#115579 - 2004-03-05 05:54 PM Re: Help, getting really confued! :-(
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
This 'https://support.dell.com/ProductSelection.aspx?SvcTag='+$serno is not working...double % and & is not working either...hummm what 2 do
_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#115580 - 2004-03-05 05:59 PM Re: Help, getting really confued! :-(
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
What about doubling the "??"?

In KiX, the ? is reserved.

So, it should be -

'https://support.dell.com/ProductSelection.aspx??SvcTag='+$serno

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#115581 - 2004-03-05 05:59 PM Re: Help, getting really confued! :-(
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
http://support.euro.dell.com/uk/en/index.asp?referrer=%%2Fuk%%2Fen%%2Fhome%%2Easp&&segment=BSD .... the same... not working :-(
_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#115582 - 2004-03-05 06:08 PM Re: Help, getting really confued! :-(
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
Now somthing happens, I doubled the ? and its move on to secound page, but its not using the $setag value as it should...
http://support.euro.dell.com/uk/en/index.asp??referrer=%%2Fuk%%2Fen%%2Fhome%%2Easp&&segment=BSD

stil




Edited by Cyrus (2004-03-05 06:09 PM)
_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#115583 - 2004-03-05 09:30 PM Re: Help, getting really confued! :-(
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
here is the IBM page...

"http://www-306.ibm.com/pc/support/site.wss/quickPath.do?quickPathEntry="+$serno
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#115584 - 2004-03-05 09:41 PM Re: Help, getting really confued! :-(
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
this seems to work fine for me:

Code:
$cmd = 'http://support.euro.dell.com/uk/en/index.asp?referrer=%%2Fuk%%2Fen%%2Fhome%%2Easp&segment=BSD'
shell 'cmd /c start ' + $cmd

_________________________
Eric

Top
#115585 - 2004-03-05 09:55 PM Re: Help, getting really confued! :-(
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
you do realize that all those addl parameters are unnecessary...

this works just fine: 'http://support.euro.dell.com/uk/en/index.asp'
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#115586 - 2004-03-06 11:22 AM Re: Help, getting really confued! :-(
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
Go to http://support.euro.dell.com/uk/en/home.asp

On "my dell" section click on the link "Set a tag for use on my support site". U will get into another page :

http://support.euro.dell.com/uk/en/index.asp?referrer=%2Fuk%2Fen%2Fhome%2Easp&segment=LCA .

In this page the value of $setag should be placed in the "Please enter your System Service Tag" box and then "GO". Then it should enter:

http://support.euro.dell.com/uk/en/home.asp This time u will see at "my dell" section info about your dell pc.

Thats what Im try to do. Forget all other pages etc.

None of the above metod works...mayby I use Sendkey... no good idea...:-(

Stil
_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#115587 - 2004-03-06 02:54 PM Re: Help, getting really confued! :-(
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Quote:

What about doubling the "??"?

In KiX, the ? is reserved.

So, it should be -

'https://support.dell.com/ProductSelection.aspx??SvcTag='+$serno




Not quite right. Things like '@' and '$' and '%' are metacharacters which can be expanded inside strings and so need special attention. "?" is simply a keyword in the same way as "Break" or "Cls". When it is in a string it has no special meaning - at least not to KiXtart.

Top
#115588 - 2004-03-06 03:00 PM Re: Help, getting really confued! :-(
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Quote:

Thanx, but its not working :-( gives me "invalid method/function call: missing required parameter 1"




Apologies, I tidied up the function definition and I assumed that you would spot it.

Functions should be "black boxes". There are only two good reasons for using global variables in a function, and you are unlikely to come across them soon.

Therefore, to call the function, pass the parameters:
Code:
$sResult=Vensupp($model,$setag)


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 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.142 seconds in which 0.056 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