Jump to content

How to copy & run batch file remotely

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
yogesh123

yogesh123

    Newbie

  • Members
  • Pip
  • 2 posts
Hello,
I have created batch file on my server m/c, The operation of my batch file is as follows,

1. I have log file in my server which records client login logout time,
2. For particular user if the logout log is not exist(means application is still on & it is consuming license from my license server) then i am reading the clients last login time & date,
3. Checking the date & time difference with current date & time
4. If the time difference is greater than 8 hrs & date difference is greater than 1 day
5. Then, copy the killprocess.bat file from server to client machine & execute that batch file on client machine remotely to kill that particular process.

-----
killprocess.bat file has one liner code,
cd\
taskkill /F /IM techservice.exe
------
Issues/ Problem i am facing are,
1) for copying killprocess.bat from server to client machine requires shared folder on client pc. But my domain restrictions doesn't allow me to share folders in client pc.
2) even if i manage to copy the killprocess.bat file somehow, for executing that batch file remotely using PSEXEC command also requires shared path where the killprocess.bat is kept - How can i execute process remotely without having shared folder in client pc?
or Is there any alternate to execute batch file remotely?

Thanks in advance.

#2
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
You understand doing this borders on the illegal?

#3
yogesh123

yogesh123

    Newbie

  • Members
  • Pip
  • 2 posts

TkTech said:

You understand doing this borders on the illegal?

Dear TkTech,
As i said folder sharing is not allowed, it means i'm working in domain & my domain is not having sharing rights, so my quastion was without folder sharing - How would i transfer files on remote machine.

or Is there any alternate to execute batch file remotely?