#๐ how to fix script Please ?
31 messages ยท Page 1 of 1 (latest)
@modest kiln
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
- system32 first of all is a protected folder, meaning windows will NOT let you delete it
- You forgot to put double backslashes, since a backslash is a special escape character in python
- the
==operator is for comparing 2 conditions/values, but you're using it for assigning a value- the input function is where your
Type 1 or 2should go, since at the moment you're just using the function object- You have to use colons when you're doing stuff like an if statement, for loops and such
- elif can't be used when there's only that elif, you should make the
choose == 1elif into an if statement, since elif literally means else if- Indentation, you have to use indentation when you're inside the "scope" of an if statment or a statement that includes colons, because indentation is what python uses to tell what to run in a control flow (basically if and else statements)
also i'm pretty sure system32 is a folder, not a binary
@modest kiln for further help threads, you should use this, at the moment you're missing the Explain part of the embed
- There is no If statement
- Admin permissions neccessary
Also, what you've planned doesnt work, the normal user/admin user does not have TrustedInstaller permissions.
getting TrustedInstaller permissions requires some prerequisite setup
correct, you cannot just "give" yourself the permissions.
You'd need to change the File Ownership, etc. would not recommend doing that though.
I would explain this deeper, but it would be better learned by doing sample projects/examples for yourself and learning how python works before starting
Yeah, not that much into Windows anyway, just wanted to give some context I actually didnt read the whole convo your message seemed like a bot Message ๐
lmao yeah i see how somebody would mistake that
๐
You should use "raw strings" for Windows paths. i.e. r'C:\.....'
This is because the backslash \ is interpreted by Python, for example \n means a newline character.
These are not interpreted in raw strings, so you should use the leading r' so that the backslashes in Windows paths are preserved intact.
the only problem is with trailing \
Code inside an if-statement should be indented:
if this:
print("this!")
elif that:
print("that!")
else:
print("neither")
which can be resolved by just doing / instead
Um, Yes. But do they need it?
well, they did put a trailing \
In Windows these days, yes. Happy days indeed.
they go into a system32.exe binary which would immediately error out
My question remains ๐
Did @modest kiln ever come back?
pretty sure it was just a troll post
Whenever I work on Windows dirs I would write the paths as follows: path = "C:\\Users\\MyUser\\Desktop\\System32.exe"
where there is defenitly Libs that can perform this operation better since Static Paths are not always good but I think for his example it makes sense.
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.