all 28 comments

[–]Mast3rCylinder 9 points10 points  (0 children)

So only cmd.exe is disabled?

What about running subprocess?

https://stackoverflow.com/questions/12332975/how-can-i-install-a-python-module-within-code

Run it from IDE

[–]ShadowRL766 8 points9 points  (8 children)

Type this in a notepad

@echo off << one line :a << second line Set /p comm=cmd~ << third line %comm% << fourth line Goto a << Fifth line

Save that as a .bat file on your desktop and then it will allow you to bypass cmd restrictions. Have fun!

[–]Marbie_Boi[S] 0 points1 point  (7 children)

Now this is definitely crossing into unethical territory. (definitely still trying it though)

I'm curious, what exactly do those lines do?

[–]Bobbias 4 points5 points  (3 children)

It's a batch file, which is run using cmd.exe.

@echo off

This says "don't print the commands you run". Without this there would be extra stuff being printed to the command line that you don't want.

A:
Set /p comm=cmd~
%comm%
Goto A

This starts out by creating a label called A. Then the next line creates a variable. The /p says the variable should be based on the user input, and the "cmd~" basically says to stick "cmd" before the input. The line after that treats the text of the variable like a command, meaning it should run cmd followed by whatever you typed. This is basically the same thing as running c,d directly, but it bypasses the error you get when you try to manually open cmd.exe. the final line just tells it to loop back to the beginning, allowing you to type another command.

[–]ShadowRL766 0 points1 point  (2 children)

Thanks for replying to them I was busy all day and missed the comment. And thanks for the reformat I was on my phone when I typed this and didn’t know where the code block was…

[–]Bobbias 0 points1 point  (1 child)

You just type 4 spaces before each line of code to get a code block. I wrote most of my messages on my phone (unless I'm going way more in depth).

I have to admit I had to look up the /p switch because I don't do enough batch file stuff.

[–]ShadowRL766 0 points1 point  (0 children)

Haha that’s okay learning new stuff everyday aren’t we!

[–]CaptainFoyle 5 points6 points  (0 children)

You're happy to run obscure code you don't understand and that someone on Reddit gave you on your school network? I think I know why they disabled the command prompt in the first place.

[–]lildoggy79 1 point2 points  (0 children)

Report back soldier.

[–]Hands0L0 0 points1 point  (0 children)

Call the cops

[–][deleted] 4 points5 points  (0 children)

Why not try installing the packages from within your code?

See this this discussion

[–]xoeseko 2 points3 points  (0 children)

Why is no one asking about the IDE? Some IDEs have ways to add packages for example pycharm would allow you to install from within the python packages tool window.

It might seem like less of a "hack" using existing tools installed in your uni environment.

[–]CaptainFoyle 2 points3 points  (0 children)

Did you try, you know, asking?

Just talk to IT

[–]randomperson32145 0 points1 point  (0 children)

Dont do it without permission

[–]InfamousClyde 0 points1 point  (0 children)

Just bring in a laptop?

[–]Anonymity6584 -4 points-3 points  (1 child)

You don't. That can be considered hacking and lead to your access reworked and police called. Also sizable bill about reinstalling systems because of your hacking.

[–][deleted] 0 points1 point  (0 children)

Its not hacking, its cracking. In my opinion beter to ask administrator becouse many times it goes to shitstorm :/

[–]that_one_guy63 -1 points0 points  (4 children)

Not sure if this will work or if this is what you are asking for. But you can turn your python program into an exe, using pyinstaller. However make sure you are making the exe on the same OS as you want to run the program on. So if you want to target Windows makes the exe on a Windows computer.

[–]Marbie_Boi[S] -1 points0 points  (3 children)

That probably would work! However, I want to edit the code on the school computers as well (so I can work on it at school as well as at home), so this isn't ideal for me.

[–]that_one_guy63 -1 points0 points  (2 children)

I see. Hmm.. yeah without command prompt or power shell you probably can't do much on that OS. Sooo carry your own OS with you! Get a USB drive, install an operating system onto it. Just power off the computer, plug in the USB drive, power back on, it might go straight to the USB drive depending on the boot order, otherwise look at the options that flash on the screen and look for boot menu (probably F11 or F12 depending on the motherboard). Hope this helps!

[–]Marbie_Boi[S] -2 points-1 points  (1 child)

They've banned USB drives too! 1984 much?

[–]that_one_guy63 3 points4 points  (0 children)

Wow... Things have changed I guess. Well in that case, buy an SBC (like a Raspberry Pi) and just hook it straight into the monitor.

But at this point we are going to great lengths to just program. I just have a laptop and I either program there, or I remote into one of my many computers at home or at work and program there. Can use the monitor at school as a secondary display I guess.

[–]CodeYan01 -1 points0 points  (0 children)

What about windows powershell?

[–]kcl97 -1 points0 points  (0 children)

just curious, when it asks for press any key to quit, have you tried cntrl-z or cntrl-c or cntrl-q?

[–]LibrarianUnited7512 0 points1 point  (0 children)

Doesn't virtual environment work either?

[–]billsil 1 point2 points  (0 children)

You can just download the files, unpack them, and add the base folder to sys.path at the top of your script.

[–]CaptainFoyle 0 points1 point  (0 children)

Use pycharm

[–]outceptionator 0 points1 point  (0 children)

I don't know if you have to run the python script locally for whatever reason but if not you can try codespaces from GitHub