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

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

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

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

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

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

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 for2: Starting a bat file on networked computer from local bat file question
Thread Forum
One-way file sharing problem between two networked computers Network & Sharing
Open File Security Warning when file is on different local hard drive System Security
Slow file transfer speed from DVD drive to any local HDD Hardware & Devices
starting up file is not on msconfig Performance & Maintenance
Local Network User folder/file sharing Network & Sharing
Solved AppData>Local>Temp (???) Lost file *&%@!*!! General Discussion
When does a file/folder go to AppData\ Local, LocalLow and Roaming? General Discussion

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 11:48 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33