Jump to content

Impossible automation task?

Go to solution Solved by DXMember,
7 hours ago, Hunter1428 said:

Yes all the tools have CLI support.

 

Any ideas on how to get started?

find a documentation of CLI for those tools, similar to what I linked for xcopy, msbuild and visual studio,

open a notepad and start typing in the scripts )))

Hey all,

 

Maybe a batch file is not what I need. But Just take a read and post you solutions :)

 

The Question:

How can I write a batch file to, for example: ALL WHILE THE PC IS LOCKED (WIN+L)

  • Start Visual Studio
  • Compile a specific task
  • Run the Specific Task
  • Move to the running Visual Studio Task
  • Perform operation in another program

 

Note - The procedure is about 40 operations, uses 4 types of specific software and takes about 2 hours every day to perform by hand.

The result is one compiled build.

 

The Problem:

Where I work we use every day several tools which require manual interaction in order for them to gather data from a server.

For example we use Visual Studio to compile code and other 3rd party programs to get the latest code from a number of programmers.

Unfortunately I have to do this every morning.

 

The Workaround:

For the time being I have a macro which performs all the tasks BUT! I cannot get it to run when the PC is locked.

My idea was to create this macro and use the Windows Schedule to trigger it when the PC is locked.

But as I have found with some help from Google, when a PC is locked keyboard and mouse interaction from programs are blocked.

Which makes total sense when I read it up. (But not at the time making this huge macro....... :P)

 

 

Thanks in advance for replies.

Link to comment
https://linustechtips.com/topic/809271-impossible-automation-task/
Share on other sites

Link to post
Share on other sites

36 minutes ago, jjjb said:

Why would you need to do this when the PC is locked?

Its so it can run over night.

 

We mostly have the programmers in America so the time zone is different for me in the UK.

Yeah I wont be having a 2 hour coffee break hahaha :D:D:D

 

Link to post
Share on other sites

34 minutes ago, Alaradia said:

Create a VM and run the macro on the vm that way you computer can lock and you can use your computer while the scripts running

This sounds interesting and I also found a lot of other people mentioning a VM to do this.

 

I cannot use a Linux Server as our IT will not approve of an onsite user server.

We must also use Visual Studio as that is what all our projects are built with.

 

Question:

A VM accepts mouse and keyboard input even when the PC is locked?

Or would I have to create a batch file.

If I do need to create a batch file I would need to plugin to 2 none VS 3rd party programs :/ 

Link to post
Share on other sites

so kinda it won't accept input from your mouse and keyboard but it will from the macro hopefully you're using something like autohotkey since you just run it on the windows vm and your good and you can just lock your computer and youll be fine 

Link to post
Share on other sites

Why do you want to complicate it? You don't need a Visual Studio open for that.

Just use MSBuild.exe to compile from command line

put the batch into a Windows Scheduled Tasks and set a trigger

 

https://msdn.microsoft.com/en-us/library/ms164311.aspx

CPU: Intel i7 5820K @ 4.20 GHz | MotherboardMSI X99S SLI PLUS | RAM: Corsair LPX 16GB DDR4 @ 2666MHz | GPU: Sapphire R9 Fury (x2 CrossFire)
Storage: Samsung 950Pro 512GB // OCZ Vector150 240GB // Seagate 1TB | PSU: Seasonic 1050 Snow Silent | Case: NZXT H440 | Cooling: Nepton 240M
FireStrike // Extreme // Ultra // 8K // 16K

 

Link to post
Share on other sites

1 hour ago, Alaradia said:

so kinda it won't accept input from your mouse and keyboard but it will from the macro hopefully you're using something like autohotkey since you just run it on the windows vm and your good and you can just lock your computer and youll be fine 

I did see a lot of info on Autohotkey but I never understood what it was.

I guess its a coding program?

Link to post
Share on other sites

1 hour ago, DXMember said:

Why do you want to complicate it? You don't need a Visual Studio open for that.

Just use MSBuild.exe to compile from command line

put the batch into a Windows Scheduled Tasks and set a trigger

 

https://msdn.microsoft.com/en-us/library/ms164311.aspx

Yeah I found a lot of stuff to show that VS does not need to be open to compile.

 

But the first task I have to do is sync the latest code with a 3rd party tool. This is also done manual.

Can MSbuild.exe control other programs other then VS?

Link to post
Share on other sites

40 minutes ago, Hunter1428 said:

I did see a lot of info on Autohotkey but I never understood what it was.

I guess its a coding program?

its not really a coding program its a language but its really basic but powerful you can use something like scite for autohotkey to record your actions to make it easy what macro software are you using atm.

 

here's a good guide on it its really useful 

https://www.computerhope.com/tips/tip209.htm

Link to post
Share on other sites

7 hours ago, Hunter1428 said:

Yeah I found a lot of stuff to show that VS does not need to be open to compile.

 

But the first task I have to do is sync the latest code with a 3rd party tool. This is also done manual.

Can MSbuild.exe control other programs other then VS?

Not really, but don't your 3rd party tools also have CLI?

 

If by syncing code you mean "Get Latest..." from repository, then you can do that from command line

https://www.visualstudio.com/en-us/docs/tfvc/get-command

https://gist.github.com/davfre/8313299

 

if it's some manual copy pasta, then I'm pretty sure you can still do that with xcopy

https://technet.microsoft.com/en-us/library/cc771254(v=ws.11).aspx

CPU: Intel i7 5820K @ 4.20 GHz | MotherboardMSI X99S SLI PLUS | RAM: Corsair LPX 16GB DDR4 @ 2666MHz | GPU: Sapphire R9 Fury (x2 CrossFire)
Storage: Samsung 950Pro 512GB // OCZ Vector150 240GB // Seagate 1TB | PSU: Seasonic 1050 Snow Silent | Case: NZXT H440 | Cooling: Nepton 240M
FireStrike // Extreme // Ultra // 8K // 16K

 

Link to post
Share on other sites

6 hours ago, DXMember said:

Not really, but don't your 3rd party tools also have CLI?

 

If by syncing code you mean "Get Latest..." from repository, then you can do that from command line

https://www.visualstudio.com/en-us/docs/tfvc/get-command

https://gist.github.com/davfre/8313299

 

if it's some manual copy pasta, then I'm pretty sure you can still do that with xcopy

https://technet.microsoft.com/en-us/library/cc771254(v=ws.11).aspx

Yes all the tools have CLI support.

 

Any ideas on how to get started?

Link to post
Share on other sites

7 hours ago, Hunter1428 said:

Yes all the tools have CLI support.

 

Any ideas on how to get started?

find a documentation of CLI for those tools, similar to what I linked for xcopy, msbuild and visual studio,

open a notepad and start typing in the scripts )))

CPU: Intel i7 5820K @ 4.20 GHz | MotherboardMSI X99S SLI PLUS | RAM: Corsair LPX 16GB DDR4 @ 2666MHz | GPU: Sapphire R9 Fury (x2 CrossFire)
Storage: Samsung 950Pro 512GB // OCZ Vector150 240GB // Seagate 1TB | PSU: Seasonic 1050 Snow Silent | Case: NZXT H440 | Cooling: Nepton 240M
FireStrike // Extreme // Ultra // 8K // 16K

 

Link to post
Share on other sites

3 minutes ago, DXMember said:

find a documentation of CLI for those tools, similar to what I linked for xcopy, msbuild and visual studio,

open a notepad and start typing in the scripts )))

 

Perfect, I will be sure to take a look at these.

 

I believe this has answer my question with more then enough information.

 

 

Thanks Everyone! :D

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×