Need to recover older $PATH setting - path

I have just installed an app which overwrote my $PATH variable... so now, a bunch of stuff will not work. While I have a full backup, I am hoping that there is an easier approach than to restore, get the PATH, the "roll it forward" again.
Is there a location in the windows registry (or anywhere else) that stores an older $PATH setting?
Thanks,
GS

If anyone is interested, I found the answer...
using REGEDIT, it is under
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment or
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Session Manager\Environment
In my case, it was under HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002...
GS

type in cmd:
set path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;
above code will set the path temporarily. To set permanently, add %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\; to System Properties -> Advanced System Settings -> Environment Variables

Related

Delete the installer after installation

I'm trying to have the installer [NSIS] deleted after my electron app is installed on a device, so that the user needn't do so
Is there a possible way to achieve this
So I would not really recommend it but you could try to use the Delete function, specify your installer-file and set the /REBOOTOK Flag.
The code would look something like this:
Delete path\myInstaller.exe /REBOOTOK
This Flag tries to Delete the File right away and if it fails, wich it will since the installer is running, it will delete it after a reboot.
Just keep in mind that you would have to reboot your computer after the installation or the file will not be deleted.
Let me know if this solved your problem.

Programatically get system32 path in command prompt

I'm using a command process in another program that for some odd reason does not have the system32 set in the path environment variable. I can use the %comspec% variable to get the path C:/windows/system32/cmd.exe, but I need to just have the folder by itself.
I am not overly familiar with command prompt programming; is there a way that I can just add the system32 (or equivalent) path programmatically?
What do you mean programmatically? If you're refering to a variable, there is no standard variable for system32. However you could use %WINDIR%\system32 or %systemroot%\system32.
While it appears that there is no environment variable for obtaining the system32 folder (or its equivalent) on a system, I did find a solution involving string manipulation. The following block of code will add the folder where the cmd.exe path is located:
SET str=%ComSpec%
SET str=%str:cmd.exe=%
SET PATH=%PATH%;%str%
It is very nice answer. i have tried and worked out. This problem comes with window7 OS probably.
SET str=%ComSpec%
SET str=%str:cmd.exe=%
SET PATH=%PATH%;%str%

Permanent environment variables

I have a problem assessing my advanced settings of my computer, anytime i get to the properties of my computer it freezes and vanishes, I decided to set my path through the command prompt. Though the lines below works. Its just temporal and the path is unset immediately i close the running command prompt,
set path=%path%;C:\python27
I am just wondering why my computer's property panel vanishes.
Any others ways to set the environment variables permanent?
try using setx PATH "%PATH%;C:\python27"
Note that u need to close the current cmd window, after executing this command as the changes will reflect in newer instances only.

can i change VIMRUNTIM if i want to move/usr/share/vim/vim71 to other path?

if yes, how to change such variable?
should i modify vimrc? but vimrc is in $VIMTIME, if i changed it, how vim find it?
i maybe have lots copies of VIMRUNTIME, and i hope that i can switch to different VIMRUNTIMEs easily, how to make this done.
anybody here who have ever tried to do this?
btw, there are lots of .vim files inside $VIMRUNTIME, are they all vim plugins? is .vim files all writen in vimscript? what vimscript can do and what it cannot? why not all vim plugins implemented using .vim? since i find some vim plugin also use script language such as perl or python...
The gory details are documented under :help startup, but you rarely need to modify $VIMRUNTIME. You didn't mention why you would want to do this, but it's probably a bad idea.
If you don't want to set the VIMRUNTIME environment variable in the shell from which you launch Vim, you can modify it in a user-specific ~/.vimrc (via :let $VIMRUNTIME = '/path/to/it'), because that one is read before the system-wide configuration.
The runtime files contain the help documents, default configuration, filetype detections and syntax highlightings. You can add your own extensions (e.g. downloads from http://www.vim.org) in ~/.vim/.... As I said, there should be no need to mess with the system-wide runtime; this is managed by your system's package management.

Xcode won't let me create a snapshot, because I don't exist

just tried to create a snapshot of one of my projects. It didn't work, and Xcode did throw the following error at me: "Unable to create a snapshot. fatal: You don't exist. Go away!"
Source control commit doesn't work either. Ok, obviously there's something wrong with my local repository. I don't have the slightest idea, what that could possibly be, though. I have not committed in quite a while, but except some updates to Xcode itself, nothing major happened to the project folder, as far as I can remember.
So, what can I do about it? Is it possible to deactivate source control for that project and then start over again with source control with the projects current status? I don't need the previous versions anymore, so that doesn't need to be taken care of.
Thank you!
Looking into the git source code, this error message is generated only if
pw = getpwuid(getuid());
fails.
It indicates that the system wasn't able to find an entry for your user account in /etc/passwd or equivalent.
This can happen if your account is removed (via deluser, userdel, or something else) while you're logged in, or if you don't have read permissions on /etc/passwd (the latter should never happen).
Try the following commands at a terminal prompt:
whoami
id
ls -l /etc/passwd
grep "^${USER}:" /etc/passwd
According to the git documentation, this is the meaning of your particular error:
You don't exist. Go away!
The passwd(5) gecos field couldn't be read
This typically means the system doesn't know who you are (you'll see this sort of error on a Linux system if you delete someone's user account while they're still logged in). Is everything else working? That is, can you log out and log back in without a problem? Do other terminal commands operate correctly? What about the id command?
Can you interact with your repository on the command line? What happens if you cd into the directory and try something like git status?
WendiKidd's solution of just starting from scratch is probably the simplest thing to do, assuming it works, but you'll lose any change history already associated with your project.
I had this issue with git and running
dscacheutil -flushcache
in the terminal fixed it.
I would suggest creating a new project entirely, copying your code etc. files out of the old project, and simply migrating over into a new one (which you could then recommit to another source control directory). That seems like the easiest solution; this is a very odd error, and I've come across things in the past that are either unfixable or would take more effort to fix than taking 10-15 minutes to just set up a new project.
So that's what I'd recommend--hopefully that will fix your problem, and whatever xcode is mad at is in some hidden file or the .xcodeproj itself, and not in the files you'd need to migrate over.

Resources