r/learnpython • • Feb 13 '22

Script that can log into my computer at a set time with my credentials

At my job it takes about 5 minutes for the computer to load to the desktop. Is there USB script I can use that can auto input my login credentials at a set time every week?

I’d like to arrive to work and my system is already loaded for me to start working.

2 Upvotes

34 comments sorted by

33

u/EIGRP_OH Feb 13 '22

Sounds like even if you could get this to work it would violate a ton of your company’s security measures.

Any chance you could get a new computer? 5 minutes to load to desktop is excessive.

-6

u/kingofmocha Feb 13 '22

Unfortunately I’m not a coder and they’re very lenient but the systems they give us are very slow. 2 core 2 thread VMs with 4gb virtual memory.

1

u/Luxi36 Feb 14 '22

I have a whole ETL workflow for a client running on 2 CPU, 4gb ram, the vm also starts up within 2 min. Shouldn't be too little for light work.

-16

u/kingofmocha Feb 13 '22

And it’d violate it mostly if I installed actual software but if the script runs of a USB then it’d be great

30

u/rusticus Feb 13 '22

OP, this is a bad idea... do not do it. If/when your security team finds this you'll be in hot water.

15

u/rusticus Feb 13 '22

Thanks for the down vote, but I've spent an entire career in IT. This is the type of stuff that gets people walked out the door.

3

u/MorgoRahnWilc Feb 13 '22

You tried. I’m skeptical of this use case anyway.

0

u/kingofmocha Feb 13 '22

I appreciate the advice though. If someone else is reading this and they know it might result in disciplinary action I would highly not recommend it

-9

u/kingofmocha Feb 13 '22

Our company is very lenient and if they find it all I’ll get is a warning at most. My relationship with management is very good and I’ve done many stupid things but still never fired or even written up lol

16

u/shiftybyte Feb 13 '22

Login, and go get a coffee?

2

u/kingofmocha Feb 13 '22

The time it gets to load I can probably squeeze in a breakfast too lol

6

u/VexisArcanum Feb 13 '22

Is there a way? Of course. First thing that comes to mind is a rubber ducky. Should you? No absolutely not

1

u/kingofmocha Feb 13 '22

With a name that cute I should absolutely do! Although I googled it and it seems a bit malicious and I don’t want to install a virus at work lol

1

u/VexisArcanum Feb 14 '22

It's only malicious if you tell it to be :)

2

u/kingofmocha Feb 14 '22

How can I make it a good ducky lol

1

u/VexisArcanum Feb 14 '22

Don't tech it bad habits

9

u/hardonchairs Feb 13 '22

This is completely dependent on a ton of information that you did not provide... Such as, log in to what?

1

u/kingofmocha Feb 13 '22

Oh so it’s a screen before you can access the windows desktop. It requires a username and password and once those are entered you’re logged into the windows desktop

7

u/hardonchairs Feb 13 '22

You need to be very specific. Are you on a windows machine and you are logging in to a windows remote desktop machine? "A screen" doesn't mean anything.

1

u/kingofmocha Feb 13 '22

It’s a windows machine and I’m logging onto a remote windows desktop machine.

6

u/hardonchairs Feb 13 '22

In the remote desktop connection window click show options, enter the computer url and your username. Check "Allow me to save credentials". Then click Save As and save the rdp file somewhere. Test it by double clicking on it. It should ask for credentials the first time, then save them after that.

Next open the start menu and search for Task Scheduler. Click Action > Create a Basic Task. Name it, click next. Choose Daily/Weekly, whatever, Next. Put in the time you want, click next. Start a program> next. Browse for your rdp file, next. Finish.

2

u/kingofmocha Feb 13 '22

I’ll do it tomorrow morning! Thank you so much this is gonna save me so much time!

5

u/free_the_bees Feb 13 '22

Save “so much time”? I thought it was saving five minutes!

You’ve presented a technical problem but I think you may want to take a step back and examine your relationship with time. 5 mins per day is barely anything. I take longer shits sometimes.

3

u/kingofmocha Feb 13 '22

It takes 5 minutes to load so I have to sign in 5 minutes before my shift starts and just stare at a blank screen for 5 minutes. It’s infuriating and each day it eats out of me

2

u/free_the_bees Feb 13 '22

So the real issue isn’t the login time, it’s that your not getting paid for it. Take it up with r/antiwork, I’m sure they will have lots of ideas. Some might be reasonable.

But again, it’s five minutes. Surely your commute is considerably longer. You don’t get paid for that either.

2

u/kingofmocha Feb 13 '22

True but there’s something extra demeaning about having to come in extra early just so you can access your system and start your shift. I’m gonna post it now thank you for the suggestion!

2

u/NotACoderPleaseHelp Feb 13 '22

You might want to look into powershell or bat files for that. And really talk to your system admin first on this, as this could really be taken for something else.

1

u/kingofmocha Feb 13 '22

I would prefer not to use a bat file. The most effective way would be a USB. All I need it to do is type in my username + password and click enter, at 8:25.

4

u/NotACoderPleaseHelp Feb 13 '22

A usb drive is a storage medium.

A bat file (for windows) is a bit of code that will run on command.

Really if you wanted to automate a long on process it would be doable with task scheduler and a bat/PowerShell script, as your log in credentials could be kept in a medium that is not a removeable drive.

But with that being said what you are asking and hinting for is really sketch, and I suggest you learn the trade if you really want to do it.

4

u/betrex Feb 13 '22

First of, this is a very bad idea. If this is a company provided computer, try pitching your problem to management/IT and fix it by getting a SSD, so boot time will no longer be an issue.

That being said, you could program a microcontroller like an Arduino pro micro or Teensy to do that for you. This can be done with cython (i believe), though u will usually do this in C using the Arduino IDE. You could just google for programming an Arduino with Python if that‘s your only option

0

u/kingofmocha Feb 13 '22

Thank you! Yes I figured a regular USB wouldn’t do. Only problem is I don’t know how to code. I know there might be projects on GitHub that I can take but I don’t know what to search for. All I need is an executable code that types in my username, password and then clicks enter. The things we have don’t support SSD I don’t even think it has a drive at all. It seems it’s a small pc that just is strong enough to connect us to a VM

1

u/seanys Feb 14 '22

Work with the resources they give you. If all they've supplied is slow-as-crap VMs, that's their problem, not yours.

1

u/kingofmocha Feb 14 '22

Thing is I have to come in to work earlier than usual just to sign in so 5 minutes everyday I don’t get paid for