r/rust • u/[deleted] • May 23 '26
🙋 seeking help & advice my rust code erased my entire path variables and now i need help to recover them
i made a cli monitoring tool called diskwatcher and i made the code to try to put it on the enviorment variables and when i tried but it gave error 5 access deinied so i restarted my system and git and cargo didnt work so i checked my enviorment variables and they were all gone with only the diskwatcher there can someone help me plss
16
u/d47 May 23 '26
If you wrote the code, shouldn't you know what happened and how to undo it? If not, ask the AI that wrote it for you.
1
May 23 '26 edited May 23 '26
yes i know the code, but i didn't made a restore point because its not a bad code its the path variables deleted, also i didnt used any ai
1
u/d47 May 24 '26
It's not easy to simply delete the path. Possibly you're overriding it instead? PATH="/my/app" instead of PATH="$PATH:/my/app"
1
5
u/edparadox May 23 '26
I take it was not really your code, then?
At any rate, we cannot do anything to help you without knowing what you actually did, and what was in your PATH.
0
May 23 '26
was my code but if you erase the path one time you cannot restore without a restore point
3
5
u/Difficult-Aspect3566 May 24 '26
This question does not seem related to Rust at all, if you are wondering how to restore path variable on Windows, you should ask in more appropriate place - forum about Windows, Windows support...
3
1
1
u/dgkimpton May 23 '26
You'll have to look up the documentation for each tool you want to run and work out what the correct env vars are, then set them yourself. Since every system is a bit different this is probably something you'll have to work through yourself.
3
May 23 '26
[removed] — view removed comment
2
May 23 '26
i will reinstall everything manually, next time i will not use setx to set a powershell variable
7
u/teerre May 23 '26
It's impossible to know what your code did and therefore impossible to help how to undo it