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 strongm 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
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.
 
Mike

I ran accross some code on the PCAnywhere site that helped me get started. The rest I just fudged through. Here is a example script that should show you everything you need for file transfers:

Code:
Dim oTestApp, strSource, strDestination, strCommand

Set oTestApp = CreateObject("AWREM32.APPLICATION")

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

'Transfer From Host
strSource = "C:\testfile.txt"
strDestination = "C:\temp\testfile.txt"

bResult = oTestApp.FileXferFromHost(strSource, strDestination)

if bResult = True then
  MsgBox "Transfer from host successful"
elseif bResult = False then
  MsgBox "Transfer from host not successful"
end if

'Transfer to Host
strSource = "C:\temp\testfile.txt"
strDestination = "C:\testfile.txt"

bResult = oTestApp.FileXferToHost(strDestination, strSource)

if bResult = True then
  MsgBox "Transfer from host successful"
elseif bResult = False then
  MsgBox "Transfer from host not successful"
end if

'Execute Program on remote computer
strCommand = "C:\winnt\notepad.exe"
bResult = oTestApp.ExecuteHostFile(strCommand)

It is worth mentioning that the OLE is capable of alot more than this if need be. Let me know and I can post more code if you need further functionality.

Hope this helped.

Roger
 
Roger,

I can't thank you enough for the help. I couldn't get the syntax for creating the AWREM32 object. All the documentation showed was accessing the RemoteDataManager object which is fine but not what I needed for the actual transfers. I understand all the functions and I am moving along now.

Again thank you for your time, I really appreciate it.

Mike
 
I had this exact same problem and came here looking for an answer. Thank you very much!!!
 
Roger,

Where did you find the sample code on Symantec's site? I went through their support process and they say they don't support the OLE tools.

I am trying to start a remote control session through the OLE tools. Any ideas how I might do this?

Thanks,

sdillard
 
sdillard,

I can email you the PDF for the ole or you can find it on your PCAnywhere CD under the file name "pcaole.pdf".

A couple questions:

Are you going to need to use the remote control session yourself or just use the remote control session via script?

Interactive or scripted? That may be more clear a way of putting it.

I have attempted to start a PCAnywhere session via a script and using it interactively and have been unsuccesful. I kind of gave up because I realized there isn't a real use for that feature in my setting. If I am going to use it interacively I can just start the host session myself.

Let me know what you need and I will try to help.

Roger
 
I will need to use the remote control session after it is started. I actually want to record (using a separate application) whatever is being done on the remote PC. My application will start a remote control session (based on a schedule) and then stop it (based on the schedule). From what I could tell, the OLE toolkit provided only allows file transfers and such. I won't be doing anything other than observing what is happening on the host PC.

Thanks
 
Roger,
I'm like sdillard & fwadmin. I was having trouble with the AWREM object and found little help in the PCAnywere documentation or the Symantec site. Thanks - and have a star. :)
Charlton --------------
A little knowledge is a dangerous thing.
 
Incredible. I've been trying to get this function to work for 2 months... Thanks soo much!
Ben
 
Thanks
The code I used was :-

bResult = oTestApp.awConnect("c:\windows\All Users\Application Data\Symantec\pcAnywhere\data\test.chf")

and connected to the host. Is there a way I can avoid/bypass/automate inputting the UserName and Password once they are known to me?

Basically I want to transfer a file without user intervention.

Dominic
 
There is not a way to skip over the password in PcAnywhere.

The only way I can think of is to use vbscript and sendkeys.dll to send the password to the dailog box just like someone was there typing. IMHO this is highly unreliable and I wouldnt use it, but it is an option.

On the flip side could you possible FTP the file you are transferring? That is easily automated.

Hope this helps.

Roger
 
I am trying initate the pcAnywhere application with task manager then use the automatic file transfer. The issue I am encountering is initiating the dial up...any code to do this pre-existing?
 
Hi you mentioned about newer versions of pcAnywhere doesn't support scripts. Can you tell me from which version?
Thanks.

seauch
 
Any version later than 9.2 does not support scripts if memory serves.

Roger
 
1) I have a VB application running in the client.
2) My SQL databse is in the webserver (Internet)
3) I have a dll in the webserver which has query.
4) when i do an action in the client (VB Application) it has to go to the webserver, invoke the dll (Query) and then retrieve the data from the database to the client.
 
Meldric,

Thanks a bucket for what you have posted about the awconnect command, helped me out heaps...

I was just wondernig if you or anybody else has been able to work out how to get the Launch command in the HostDataManager methods to work?

For me, it seams to say it worked out, but no Waiting screen is loaded...

Thanks In Advance

Marcus
 
I have also come across another issue, I am not sure if anybody else has had this same problem...

When I dial a HOST it seams to only allow about 30 seconds before it will timeout/stop the call.

Is there a setting somewhere that can change this, as some of the HOSTS I dial take lnoger then this to answer.

Thanks Again,

Marcus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top