0

I am trying to create a word document on a remote windows machine. What I am trying is to telnet to the remote windows machine and run a perl script that creates word document through Win32::OLE. But it doesn't seem to work. Is this possible? Because my script has {visible} set to 1 but will that telnet session have access to instances of word application? Atleast I tried it didn't work.

Anand
  • 355
  • 1
  • 2
  • 12
  • Please let me know if something isn't clear. – Anand Aug 30 '12 at 03:36
  • OLE exception from "Microsoft Word": Command failed Win32::OLE(0.1709) error 0x800a1066 in METHOD/PROPERTYGET "SaveAs" C:\Users\Administrator> – Anand Aug 30 '12 at 04:11

1 Answers1

2

Telnet may not be the best tool to accomplish this, I'm not sure what kind of permissions it has. I recommend using PsExec, which allows remote command execution on windows servers. If it works locally, it will work using PsExec.

For example:

PsExec.exe \\remotecomputer -u userName -p Password Perl C:\path\to\file\file.pl

You can use the -s flag to run as system account, and the -i flag to run it interactively on the desktop. Without the -i flag, it will run in the console session.

Tadgh
  • 1,999
  • 10
  • 23