Accross Network

Closed
Thirsty crow - Dec 5, 2008 at 10:37 PM
TheParoxysm Posts 169 Registration date Sunday December 7, 2008 Status Member Last seen March 25, 2011 - Dec 8, 2008 at 10:30 PM
Hello,
I m fine and hope it will same form you. I m trying a think for many months but not getting any reward and problem is not solving. i have tried every thing like FTP, netcat , telnet and batchfile but i m not succeeding Access denied error occure i m going mad. Here is the code for this

Dim fso, WshNetwork
Const OverwriteExisting = True
WshNetwork = CreateObject("wscript.network")
fso = CreateObject("scripting.filesystemobject")
WshNetwork.mapnetworkdrive("x:", "\\10.1.0.100\c$", , "username", "password")
fso.CopyFile("C:\batch\remote.bat", "x:\remote.bat", OverwriteExisting)


when i run this code and error occure Cannot use paraentheses when calling a sub
any help will be greattttttttttttly appriciate

1 response

TheParoxysm Posts 169 Registration date Sunday December 7, 2008 Status Member Last seen March 25, 2011 74
Dec 8, 2008 at 02:48 AM
In the future it's probably a good idea to note what language you are programming in, and what version.

In this case I suppose Visual Basic (VB) and probably .NET though you've said nothing to support that.

I need you to be more specific, what are you trying to send where, and is this a program that needs to work no matter where it is, or do you have static places in YOUR network for it to go?

As far as your error:

You invoked a subroutine without the Call statement, but used parentheses (). When calling a subroutine without the Call statement, do not use parentheses.

To correct this error

* Remove the parentheses from the subroutine invocation.
* Use the Call statement to invoke the subroutine instead.
0
First of all thanks for your reply!!!!

I m doing this in VBS.
And u said that why i m doing this the reason is that i m working in a computer lab. Some time its very difficult to copy a file across all pcs of ur network. Like adobe Flash player etc. so i was making a program that will compy a file form my computer to all computer of my network..
So what do u say what should be done for this..............
Thaks
0
TheParoxysm Posts 169 Registration date Sunday December 7, 2008 Status Member Last seen March 25, 2011 74 > Thirsty crow
Dec 8, 2008 at 05:34 AM
I would honestly just make a shared directory. Since they are all attached to the same network, you can make sure they are all on the same workgroup or domain and then have one share out a directory (folder) and just put whatever you want to share in there.
Then you can create a shortcut or map a network drive to it on the other computers for easy access.

It would work like it was on that computer natively.
0
Thirsty crow > TheParoxysm Posts 169 Registration date Sunday December 7, 2008 Status Member Last seen March 25, 2011
Dec 8, 2008 at 09:38 PM
But dear i want to do this with programming!!
0
TheParoxysm Posts 169 Registration date Sunday December 7, 2008 Status Member Last seen March 25, 2011 74 > Thirsty crow
Dec 8, 2008 at 10:30 PM
I'm sorry, I merely suggested that because I was taught to find the simplest solution first.

I suggest you try looking on https://www.codeproject.com/ as it is a resource of submitted code snippets with a place for looking for help with particular things. It has project files for you to download that allow you to see first hand how people solved problems and how it worked.

Good luck!
0