Mobaxterm profile will be reset when I restart the Mobaxterm - terminal

I use home edition Mobaxterm,and my /etc/baseprofile will be reset when I restart the Mobaxterm. Not only /etc/baseprofile, but also other files, such as /etc/hosts will meet the same situation.
How can figure out this problem?

It's one of the limitation of the home edition as precised in the banner that is displayed on each of the window you open and in http://mobaxterm.mobatek.net/download.html :
Customize your startup message and logo
Modify your profile script
If you make the root of your MobaXTerm local to your disk you can modify the /home/mobaxterm/.bashrc to do your customization. You can always use the portable version (no Administrator rights are needed) but you will have a subdirectory MxtRoot somewhere on your local disk.

Related

Windows: XAMPP install folder ini file permission error, Access denied upon configuration save

After installing XAMPP to Windows 10 (all default/recommended installation attributes), I now have an issue changing its configuration after opening it.
Error: Cannot create file "C:\xampp\xampp-control.ini".
Access is denied
Clicking Save to a change in Configuration of Control Panel:
This "Configuration of Control Panel" box opens after clicking the "Config" button at the top right of the running XAMPP app:
I've tried a suggestion to run the XAMPP app with Administrator (elevated) access… but that seems like a major security issue, considering I don't know exactly what XAMPP would or could do with my files that require that permission, whether intended by the people who run XAMPP or not.
I've tried re-installing to another folder, like to C:\Users\Me, or a sub-folder like Documents or a custom one, but I just got different permissions issues that I struggled to figure out.
If you know a solution that worked for you, that avoided running XAMPP with Admin privileges, please let me know. I've gone through a handful of seemingly-related questions here but they seem to be related to MySQL/PHP questions and not Windows file system permissions.
I found a solution after noticing that the file already existed from apparently a past workaround I tried with running XAMPP as Admin... based on the permissions of the file being different than its parent folder. I discovered this by right-clicking the xampp folder or the xampp-control.ini file then selecting Properties and clicking the Security tab, then clicking into each attached user account's permissions.
So, my C:\xampp folder has these permissions: for Admin, basically full access; for my user account, Read, Execute, and Write.
The xampp-control.ini file has only Admin permissions; my user account is not attached to it.
Adding my user account to the xampp-control.ini file's Security, and adding Write permission then allowed XAMPP's config panel to save my changes.
Note that I typed my username into the "Enter the object names to select" box, then clicked Check Names; this auto-populated my username reference (?), though I'm not sure how it would work if it finds multiple results. Then I could click OK to get back to the Permissions box to add "Modify" and "Write" for it. I'm completely OK giving my user account permission to modify and write to this file through the XAMPP app.
Now, that fixes that file for that scenario; now I'm wondering if there will be other permissions issues with other files, because I noticed some other files (that I checked randomly) don't all share the same permissions for my user account!
Maybe I should have instead modified the xampp folder's permissions recursively to give my user account Write and/or Modify access (I'm not sure of the difference, Windows permissions seem far more complicated to understand and use than Linux's and Mac's do).
I think the file permissions were all set by XAMPP during install; I don't know yet that expanding permissions on certain files will not create new problems...
I found a solution after noticing that error, here is my solution
go to xampp installation folder on the c drive
Xampp Destination
then find xammp control panel.exe
Xampp Control Panel
then right click and go to properties(or press ALT+ENTER)
Click Properties
then go to compatibility and enable Run this program as an administrator
Compatibility tab
Your Problem is now fixed

Can't open PowerShell with administrative rights

I'm running Windows 10 and a few weeks ago I managed to do something (in the middle of the night - can't remember) such that I can't open PowerShell (nor PowerShell ISE) with administrative rights anymore. When opening it via right-click -> as admin, the Shell opens and closes immediately. Opening without administrative rights works fine.
I managed to find the error through opening a cmd as admin and typing the command "PowerShell". It says (translated):
"The type initializer for "System.Management.Automation.Runspaces.LocalRunspace" caused an exception"
Google seems not to come up with similar cases. Any suggestions?
you could Try the new PowerShell Core it can do everything the normal powershell can do too
and its opensource :)
PowerShell Core
I solved it. The problem was, that I had changed the registry entries in "\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion" to "%ProgramFiles%" a while ago, in an attempt to change the default location of new programs to whichever path I defined in the environment variable. Now I hardcoded it to my new desired location (on D:). I can open the PowerShell as admin again.

Why does .MSI file open read-only?

I am attempting to open a .MSI installer package file to modify it. Whenever I try to open it, it opens in read-only mode. I see this with Orca, with InstEd, or when opening the file directly via code:
`MsiOpenDatabase()` (ERROR_OPEN_FAILED with MSIDBOPEN_DIRECT or
MSIDBOPEN_TRANSACT persistence modes).
The file itself does not have the read-only attribute set (in fact, has no attributes set)
I am using an account with Administrators group access
As far as I can tell, no other process has the file open
No installs are in progress or suspended
I can copy the file to another location, and open it read/write there. But the original, I cannot touch
Thanks in advance for your help.
My guess is that this is caused by one of the following factors:
Custom NTFS access rights - defined for the file in its security descriptor
The file might be "blocked" - marked with a special flag after being downloaded via Internet Explorer.
The resolution for the latter is to right click the file and select properties and click the unblock button at the bottom of the property page and pressing OK.
The resolution for custom NTFS rights are done in a similar way by going into the security
tab of the property page for the file, but it is easier just to copy and paste the file and use the fresh copy with the default security.
Found it.
#Glytzhkof, you almost had it but there's a detail I did not know about, and left out. This is a package that lies in a folder under "access protection" by my system's anti-virus program: a filesystem hook that blocks modification of critical system and AV files. Turn off access protection temporarily, and the file is wide open.
Fortunately, one of my teammates had some experience with this, and suggested I try it. Bingo.
Thanks, all.
What I have done to get it working was to create first a backup of the MSI file, and then open that backup. It worked for me
Try to close/kill processes that might interfere, for example:
Other running Install shield instances
Installshield updater
Installshield licensing service
Antivirus

Can't edit the host file

I've been trying to edit my host file for a while now and I keep failing.
I tried to open notepad as administrator and then click File --> Open and choosing the host file but I get this error message:
hosts
You don't have permission to open this file.
Contact the file owner or an administrator to obtain permission.
I tried notepad++ as well (as administrator) but I couldn't even get to the file with it (it doesn't show the etc folder in drivers).
I also tried to check my "User Account Control Settings" but it was already on the lowest level (never notify).
While looking online for a solution I've noticed more people having the same problem but I couldn't find a solution that worked for me.
I'm running Windows 7 Home Premium 64-bit
You have to run notepad++ (or your favorite text editor) as an administrator. Right click notepad++ and it should display an option to run it as admin. Once open, locate the hosts file and open it with notepad++.
Windows hosts file location: c:\windows\system32\drivers\etc
Note: copy and paste the above url in the file-explorer when opening a file within notepad++ instead of locating it manually as some directories are hidden.
If the above doesn't work, Windows 10, 8 sometimes requires you to first turn off your antivirus.
If you require editing the hosts file often, you could look into third-party freeware tools to aid you. [1][2]
This works:
For Windows 7 and Windows Vista
Click Start -> All Programs -> Accessories.
Right click on Notepad and select Run as administrator.
Click Continue on the "Windows needs your permission" UAC window.
When Notepad opens Click File -> Open.
In the filename field type the file location, i.e.:
C:\Windows\System32\Drivers\etc\hosts
Click Open.
Make the necessary changes to the hosts file.
Click File -> Save to save your changes.
In my case I could open the file (and Notepad++ was running as admin) however I could not edit it: I could neither type some text, nor delete anything - no popups, no warnings - it looked like keyboard is not working.
I copied the hosts file in the same location, deleted the original hosts file and renamed the new one to hosts. After that I was able to edit the file. I am guessing this should be some permission issue.
OS - windows 7
But first of all you have to do temporally disable your virus guard.
Dissable your antivirus and open notepad.exe with run as administrator edit your host file and save this.
'Run as admin' not enough in windows 8. Set 'modify' access also not enough if you have antivirus
So you need
1) Disable antivirus
2) Set 'modify' access for all applications
3) Modify 'hosts' file
4) Revert 1-2 steps
OK I got it! I had to right click the file, go to Properties, Security tab and click Edit.
Then I took ownership for the file and I had the ability to edit the file's permissions.
On windows 8 running notepad as administrator wasn't enough for me to edit this file. When I tried to open the file from within an administrator session of notepad the etc directory was empty. I changing explorer to show hidden files and extensions, but that only helped in explorer. To edit this with notepad I needed to modify the security settings on the file so that all users and all applications could write to the file. After I finished my changes I set the file back to read only and execute for all applications and users.
there are two notepad.exe in x64 windows,
you must use full path c:\windows\system2\notepad.exe ,this one is 64 bit version,
only type notepad whithout path may be launch 32 bit notepad.
(c:\windows\syswow64\notepad.exe)
"Run as administrator" just let you enforce launch 64 bit notepad.exe
using 32 bit software to edit c:\windows\system32\drivers\etc\hosts
the x64 system will automatic redirect to c:\windows\syswow64\drivers\etc
and there is no hosts file.
the GUI stiil display current folder is c:\windows\system32
but the real folder is c:\windows\syswow64
I had the same problem. After opening the notepad as an Administrator and editing hosts file, I could not save it (denied access). I could not even change file's permissions. What worked for me was copying the file elsewhere, editing there, and then overwriting the original through Command Prompt opened as Administrator. I didn't have to turn off antivirus program.
To open the Command Prompt as administrator, press windows+X and select that option from the menu.
Than, type: mv path-to-the-copy-of-hosts-file\hosts c:\windows\system32\drivers\etc\hosts
I just needed to uncheck "read only" property to allow modify that file.

Windows 7 - Can't update my program's files in C:\Program Files

I have an addin program that works with MS Word (version 2007). It is located in the C:\Program Files location. I installed Windows 7 and then went to make a routine change to my files in this location and it would only bring up a read only file. How can I grant myself permission to write to my own program? I cannot change this location or use any other workaround. I have this product out to 25 different companies and I can't change the programming to work from any other location. Thanks
You could also embed a manifest in your EXE that makes your program require adminrights on Windows 7 / Vista.
On Windows Vista, UAC means that users run without admin rights and don't have write access to the program files directories.
The correct solution is to write to a folder for which standard users do have write permissions.
The solution you are looking for is to make your app's folder within program files writeable to all users. You can do this by adding a DACL when installing. It is extremely bad practice to allow standard users to write inside the program files directory and I urge you instead to re-code your app so that it does not need to write there.
Assuming you're doing this as part of modifying the config (and not when your application is running for regular users)...
Your user account probably doesn't have the correct permissions to write/modify the file. Assuming your account is an administrator account, right-click the file, select "Properties". Click the "Security" tab. Click edit and give your user account Full Control.
If you can't do this, it's probably because the ownership of the file doesn't allow you. If this is the case, click on "Advanced", go to the "Owner" tab, and click "Edit".
However, if it needs these permissions when it's running, you should instead be using the %AppData% folder.

Resources