Run .bat file across network from desktop - Powershell?

I have a batch file that runs three tasks:
schtasks /run /tn "Debt Study Tab Delimited"
schtasks /run /tn "Debt Study Short Tab Delimited"
schtasks /run /tn "Debt Study PHP Conversion to XML"

Open in new window

It runs on a Windows 2008 R2 server. I've created a share to the folder that has the batch file.

What I can't figure out is how to run that .bat file from my desktop (and eventually from users' desktops) on demand. I want to put a shortcut on a user's desktop that they then double-click to run the batch file on the server. Is this something Powershell can do for me? Or do I need to look elsewhere?
chenegarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kanti PrasadCommented:
Hi

Create a short-cut to where the bat file is from your desktop\ user and double click it

\\server01\folder1\yourbatfile.bat
0
chenegarAuthor Commented:
I did that and it doesn't work.
0
Bill PrewCommented:
Are you asking how to create the shortcut, or the larger question of how to automate pushing such a shortcut to each computer automatically?  If the latter, then we would need to know a bit more about your environment, if you are a domain model, etc.

~bp
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Kanti PrasadCommented:
Hi

Go to start and in the cmd just put your path and it should run

\\server01\folder1\yourbatfile.bat

or else the computer user where you are running it don't have access to that server.  Just see if you can map that server from your computer and see if you can have access
0
chenegarAuthor Commented:
I'm not asking how to create the shortcut. And I'm also not asking how to push it out to computers on our network. I'm asking how to get a batch file on a server to run from my desktop.

I'm a domain admin and I've given domain admins full control over the folder. I've also shared the folder.

The .bat file on my desktop is:
\\METIS1\Conversion\tasks.bat

Open in new window

Where METIS1 is the server name, Conversion is the folder, and tasks.bat is the batch file.

When I run the batch file in a cmd window from my desktop, I get "ERROR: The system cannot find the file specified" for each line in the batch file on the server. So maybe I need to change the permissions on the individual tasks?
0
Kanti PrasadCommented:
Hi

From you desk-top are you able to map that server and read and write any files in that folder? If you cannot then it is do with the access
0
chenegarAuthor Commented:
Yes, Kanti, I can map to that server and folder. And I can read and write to files in that folder from my desktop. I can run the batch file in that folder from my desktop, but nothing happens, which I've assumed is because it's trying to run the tasks on my local computer, not the server.
0
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
The tasks do not exist on your desktop, I assume. So you in fact need to remote execute the tasks on the server?!
0
Kanti PrasadCommented:
Hi

Try to use  /S system [/U username [/P [password] to run that on the server

https://msdn.microsoft.com/en-us/library/windows/desktop/bb736357(v=vs.85).aspx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chenegarAuthor Commented:
Got it! Thanks, Kanti.

I'd tried to work with schtasks earlier but had trouble wading through all the options. Thanks for helping me sort this out.
0
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
That's correct, you would have to add at least /S METIS1 to each schtasks line.
0
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Might I note that my comment lead to the solution?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.