Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Starting a bat file on networked computer from local bat file question

21 Oct 2012   #1
nzdreamer55

Windows 7 Home Premium 64bit
 
 
Starting a bat file on networked computer from local bat file question

Hello everyone,

I have a bat file that is launched when a torrent finishes downloading on my laptop which launched robocopy to copy it to my server computer.

I want to have the server run a few programs to extract the file and move it to the correct directory structure.

I want to launch a bat file on the server from the first bat file using the call command, however I am not sure if this command will cause my server to execute the bat or my laptop to execute the bat.

Is there a way to get my server to run the bat from the bat that is run on my laptop?

I think that if I use the call command that it will run the called bat on my laptop even though the bat is located on my server.

Thanks in advance
-S


My System SpecsSystem Spec
.

22 Oct 2012   #2
richnrockville

Windows 7 Pro x64 SP1
 
 

Your exactly correct that the batch file will run on your laptop. The only way to run from the server is to use Remote desktop RDP from your machine to the server which will allow you to run the program in the server's memory.
Or, you could have a planned event (Task Manager) on your server which would check to see if the file exists at some point in time and then run the batch program in the servers memory space.

Rich
My System SpecsSystem Spec
22 Oct 2012   #3
nzdreamer55

Windows 7 Home Premium 64bit
 
 

Thanks so much Rich for the reply. I was using the task scheduler to run the bat every 5 minutes, however this lead to some problems if the files were being copied at the time that the bat was started.

Would you be able to help me config a way to have a planned event on my server "Check" to see if a file exists and then run a batch program?

Thanks
-S
My System SpecsSystem Spec
.


22 Oct 2012   #4
nzdreamer55

Windows 7 Home Premium 64bit
 
 

One thing that I posted a while ago in another forum was the event trigger function within the task scheduler. If I knew which log to monitor, what source and the Event ID for a file creation, then I could use the Task Scheduler to run my bat file on my server computer with out setting up a time loop. There are other small programs out there that will monitor a folder and launch a program like a bat file, but it would be nice to get away from third party software and keep a little running on my server as possible.

Anyone know how to set this up?

Thank you very much
-S


Attached Thumbnails
Starting a bat file on networked computer from local bat file question-tash-scheduler-1.jpg  
My System SpecsSystem Spec
22 Oct 2012   #5
Parman

Windows 7 Ultimate x64
 
 

You could setup a ssh server or telnet server (telnet is not secure). The batch file could open up a session and run the command through the session.

I know with putty you can have a txt file with commands listed then once the command runs it will shutdown.

example:
putty.exe -load "Session name" -l "username -pw "Password" -m c:\test\command.txt

command.txt:
netstat -a

When you run the example above it will open the shh connection (I use sessions that i have already created). Once the connection is open it will run the command in the command.txt file, then close the connection.
My System SpecsSystem Spec
22 Oct 2012   #6
richnrockville

Windows 7 Pro x64 SP1
 
 

In a batch file, you can have goto points.
:start
if exist xxx.txt goto ok1
exit
: (put ok1 here) in this forum the ok with a colon in front is an emoticon.
putyour executeor batch file here
exit
My System SpecsSystem Spec
Reply

 Starting a bat file on networked computer from local bat file question




Thread Tools





Similar help and support threads
Thread Forum
simple question regarding file size of copied and paste file
If you right click properties of both the paste file and original file and compare both of the file size shown there, if both are the same does it mean that the paste file is properly copy over?
Performance & Maintenance
Shared local printer problems with 32 bit and 64 bit networked PCs
I have 2 PCs that are networked via a broadband hub. PC 1 has Windows 7 Professional 32 bit and a HP Color Laserjet connected to it via a USB port. The printer is set to share with the other PC. PC 2 has Windows 7 Home Premium 64 bit and a OKI C511 connected to it via a USB port. The printer...
Network & Sharing
I need help with File Sharing on NOT networked PC's (XP - W7)
Morning all, I have searched the win7 forums for help with transferring files from XP-W7, but only seem to find threads with networked PC's I still have my old XP machine as a backup if my current W7 machine were to die suddenly. I keep it in the closet and wanted to take it out, hook it up...
Network & Sharing
Local State.TMP in google Chrome file
Wonder why Google Chrome has endless Local State~RF1ab586.TMP type files? I found a couple of hundred of these files. Since they are Temp. how can I clean them up? Where are they used for?
Browsers & Mail
One-way file sharing problem between two networked computers
The Problem: I have a one-way problem on a home network where one desktop (A) easily shares files from its C-drive through the router with the other desktop (B), but not vice versa. In other words, it is easy to access and transfer files from desktop A to B, but not from B to A. Other facts:...
Network & Sharing
Open File Security Warning when file is on different local hard drive
Hello and this is my First Post Can you help me with an annoying dialog that pops up when running shortcuts please? I have (portable) applications located on E: I can run those applications directly from E: without a problem - i.e. I don't get any warnings. However if I create a...
System Security

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 08:05.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App