Click here to Skip to main content
15,888,315 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,
I want to connect to another server from batch file by using the ip address and passowrd.
i have come across "net use" kinda stuff.Is there any other way to achieve it?
please provide some inputs.
Posted
Comments
Richard MacCutchan 19-Aug-14 8:29am    
What do you mean by 'connect'? Do you want telnet access, ftp, something else?
Member 11010562 19-Aug-14 8:51am    
Previously i was stuck with passing arguments to shell script now i completed that without any problems new user is creating in active directory whatever values we are providing in batch files...that was done in another server which has adminstrator rights but now i wanted to run that batch file from any system by connecting that server which having admistrative rights i hope u understand my problem.
Member 11010562 19-Aug-14 9:06am    
Addition to my question this is the exact secnario.

If I'm on computer A but I want to inititate a batch file I want to run
on computer B, how do I get the batch file? I'm not talking about a
remote desktop or anything, I want to use a command line to make a batch
file run on a remote computer.

In order to run commands remotely you need some protocol to transfer information and commands. Take a look at some of these offerings[^] for secure remote shell.
 
Share this answer
 
Comments
Member 11010562 19-Aug-14 9:52am    
Thanks Richard!!
I have gone through this command: schtasks /run /s systemname /u username /p password /TN "test1.bat" Will it work if i have admistrative rights in current system?
Richard MacCutchan 19-Aug-14 11:03am    
Sorry, no idea. But you can also check out remote powershell at: http://technet.microsoft.com/en-gb/library/dd819505.aspx.
Bark Ups 20-Aug-14 16:43pm    
to perform any action (especially) admin permission one, you need to be recognized as admin on target machine (or be recognized as someone from group that will get access). If target host is one of the AD machine under your admin account and you will perform action from this account - yes it will work.. cause target machine will recognize you as the one that can do it.

as described in schtasks help file: "schtasks /create allows ADMIN to create scheduled tasks on local and remote systems.

regards
Hi,

You can "ask" remote host to perform action remotely (in background or not), just like you are on host by using PowerShell or if you really need batch file by "older" WMIC.

example:

c:\wmic /node:hostname process call create "call c:\any_file"

where hostname=host you want to connect inside your network (Name or IP)
any_file=file you want to use

You can use buildIn WMIC API or start / stop processes


Read more here http://technet.microsoft.com/en-us/library/bb742610.aspx[^]

Regards
Hermitagup
 
Share this answer
 
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900