Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pcANYWHERE OLE code for VB 19

Status
Not open for further replies.

fwadmin

IS-IT--Management
Jun 23, 2005
6
0
0
US
I have a bunch of pcANYWHERE script files written to do various automatic transfers. It seems that Symantec's newer versions of pcANYWHERE no longer support the script files and now use OLE for integration into other applications. The documentation for this completely stinks in that they give no VB examples of invoking transfers.

Anyone out there have any VB code with pcAYNWHERE they can share?

Thanks.
 
Syrus,

Are you using PCA 11.0 or PCA 10.5? Could you point me to some documentation as to how I can achieve integration and develop PCA apps using .NET, that would help as I would need to build a case with my firm to start planning and developing in .net

thanks,
 
OK, not happy that PC Anywhere stopped using scripts, VB is not currently in my array of knowledge. However, the scripts that we have are very simple, I was wondering if anyone on the board might be able to convert the script into the necessary VB code.
Here is the Script.

Session ExitMode Cancel
Session OnError End
Session Timeout 120
Session Retry 3
Session Delay 10
Session OverWrites Always
Session Dial Z2_sayville
Sessopr Host Send "C:\transfer\sayvill.dat" "c:\transfer\sayvill.dat"
Sessopr Host Run "c:\transfer\delxfer.bat"
Session End


Thanks to anyone that can help.
 
Hi all

I want my users to connect me with pcanywhere
by letting them click a butoon in my application.

This button will start a host session and call with
TCP/IP to my constant IP.

As far as I see there is no OLE way to start a Call remote
with a host item.

So ,with the command line I open the call remote window
and with Window messaging I'm sending to the edit box
my IP and then click on the Ok button.

If there is a simple way doing it I'll be happy if you share.

My second problem is that I want my Host item to be in
a different folder So I'm useing the ChangeDirectory function and is does changes
but when trying to activate the launch or anything else
I get an Error message "..invalid directory..."

If so whats the point letting us change the directory ?

Is the only way to do that is with regedit ?

Heavy stuff Haa?

Ilan








 
Roger, are you there?

I could you some of your help with PcAnywhere 10.5 on XP.
 
Wow, I'm so glad I found this forum. This is great, we've had one Win98 PC for a couple of years now doing our polling with pcAnywere 9.2 because of the scripting issue with version 10. I have a question though, I can't seem to pass on the phone number to my CHF file. I know I'm way off, because I'm pretty new to VB6, but this is what I have.

oPullSMCR.awConnect (strfilesdir)

Let me explain this, strfilesdir will be changing each time it dials a new computer, if I put strfilesdir in the Immediate Window this is the results:

"C:\Documents and Settings\All Users\Application Data\Symantec\pcAnywhere\BCM.chf" /c1-555-555-5555

From what I'm seeing, I can't pass on the phone number this way. It just passes right over the oPullSMCR.awConnect step and never attempts to even bring up pcAnywhere. Now, if I put the actual path to the chf file in like this it works fine:

oPullSMCR.awConnect ("C:\Documents and Settings\All Users\Application Data\Symantec\pcAnywhere\BCM.chf")

But the string is needed because, 1. the phone number will change, and 2. the .CHF file will also change. Thanks for any help you may have, and keep up the great work.
 
Nucklez,

what I did to make that work is create a chf file for every host i want to connect to (add a new remote in pcaw), then loop through all the chf files in the pcaw directory. My program dials 3 different remotes twice a day and retrieves files. I use delphi, but the same scenerio will work in vb.

hth,
drudge
 
aroelsler,

Yea, that is what I'm trying to get away from actually. I have 150 remote locations that have unique phone numbers, and keeping up with them would be a pain on the seven people here that have to constantly use this. Right now I'm using the command line parameters with one .chf file, and a SQL database to keep up with all the phone numbers. Thanks for your help though man!
 
From what I've figured out so far, I'm going to have to create a REMOTEDATAMANAGER object, and use it to change the phone number. I just gotta learn how to do that. haha!
 
Nucklez

Heres how to create your remote(caller objects, .chf's)

dim oremotedatamanager as object
dim oremoteobject as object
dim shostname as string
dim sphonenumber as string
dim sinputline as string

Set oremotedatamanager = createobject

("winawsvr.remotedatamanager")

' Get your object params here from a database/flatfile ..
' eg: if you are getting from a flat file which has format
' <hostname>,<hostphonenumber>
' Pseudocode:
open <flatfile> for input as #1
While NOT EOF(1)
line input #1, sinputline
sinputline = trim(sinputline)
shostname = left(sinputline,5)
sphonenumber = right(sinputline,10)

set oremoteobject = oremotedatamanager.createobject (shostname)
oremoteobject.phonenumber = sphonenumber
' you just created a caller object and set its phone number
' all its other required properties will be inherited
' from the default object in your current PCA directory


WEND
Close #1
Set oremoteobject = nothing
set oremotedatamanager = nothing

Hope this helps ...
 
Forgot to mention you have to reference winawsvr.tlb
and
you have to use the <writeobject> method to write the phone number and other params you need to write into the object.

 
sibasis,

Yes sir, that helped out a lot! Like I said earlier, I'm new to VB, and don't understand OLE very well either. I was able to figure out what I needed from your code.

Thanks again.
 
Hi
My scenario is: Pca remote makes a modem connection to a
waiting host (pca 10.5, windows 2000) after the remote log in a file is sent from remote to host, a batch file runs some programes and a file is returned from host to remote.
All the above is automatic no user or operator intervention.
My question is what is the command for progrmaticaly transfering files.

Thanks for your help Rambleon.

Are there any forums or user groups for pcanywhere? maybe we can start one here.
 
rambleon,

if you are looking for an automated file transfer mechanism using pca10.5 and VB pls check posts above in this thread for your answer.

Neways heres how your algo should be

create an instance of awrem32
connect to the host using awconnect method of awrem32
Execute your batch files using 'ExecuteHostFile' method
give appropriate delay
and transfer your results file using 'FileXferFromHost'
disconnect.
 
Sibase Hi,
Thanks for your response. My situation is that the host modem is waiting for a call, I want to start the file tranfer and batch exacution after the remote has logged in using: Command to execute after connection.
I understand at this point a connection has already been established so there's no need to use awConnect. Please can you post a revised algo or tell me where I'm going wrong

Thanks

Rambleon
 
Where can I find more information regarding PcAnywhere and Automation. Would appreciate useful links.
 
Hello Everybody (Hello Dr. Nick!)

Thanks for all the posts they have been very helpful.

Problem:

I am not able to execute a .bat or .exe file on the host computer.
I have tried to execute a file that already existed on the host computer and I have also tried to send the file first.

When I run the ExcuteHostFile command what I get on the Host computer is a File Transfer Status windows that says its waiting. This window does not show a file name.

The script that I am using for now is very similar to the second one on this thread.

Thanks in advace:
privacy

My systems:
Windows 2000 Pro SP4
PCA 11.0.1
VirusScan Enterprise 7.1.0
Office XP
 
Just for the record, we recently ordered the version 11.0 of PC Anywhere, as the VB scripts were driving me crazy. Version 11 has a new feature called Command Queue. It brings back the old script features from version 8, just in a more user friendly interface(GUI). Our scripts are simple, we pick a site, dial up to it, copy a file off the site, then rename the file on the site and disconnect.

It took about 10 minutes to install 11.0 on 2 computers, create the Command Queue File and execute it. It works just fine now!

Just my two cents for those that are struggling with the VB Scripts.

Matt
 
I've also installed pca 11.0 (25$ from after not having any success with vb scripts. What I want to do is wait for a call and when a user logs in automaticaly transfer a file from the user run some programs in a batch file and return a file to the user, disconnect and wait for the next call.
I still haven't worked out how to do this using command queues. The problem is to run a command queue I have to be the Remote but to run a batch file from the command queue the batch file has to be on the Host, also the command queue won't start if I'm a remote waiting for a call.
Any Ideas ?
 
Has anyone been able to pass a parameter to a batch file and executed it on the host if so how ?

Code:
   hostexe = "c:\somefolder\somemove.bat a"
   WentOK = remote.ExecuteHostFile(hostexe)
   Pause

I am posting this same qns after 1 year :eek:)

thanks !
 
sibasis
Just a thought if you call the batch file from within somemove.bat and put the parameter there will that work ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top