Read remote file without file sharing

7.3k views Asked by At

I'm trying to read a file on a remote computer however, ports for file sharing are blocked. Actually most porst are closed and only have access to execute WMI and Registry queries.

Is it possible to read or pull data from a remote server using WMI or the registry?

2

There are 2 answers

0
RRUZ On

The WMI doesn't allow read the content of any local or remote fil. Instead provides a set classes to list, copy, rename, compress and get info about files and directories. These classes are CIM_DataFile, CIM_Directory and Win32_Directory. If you want to see a sample of how use these classes check this article Manipulating local/remote files and folders using Delphi and WMI which I wrote some time ago.

0
Lizz On

There's another possibility, created by Frank White a few months ago using this "cmd /c echo ..." approach:

strCommand = "cmd /c echo myTextCommands > c:\temp\testscript.txt"

To see a fully-fleshed out VBScript, see my solution here