Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ninp0/c0a431e52e3402713916e0361c83b94e to your computer and use it in GitHub Desktop.

Select an option

Save ninp0/c0a431e52e3402713916e0361c83b94e to your computer and use it in GitHub Desktop.

Steps to Make the doskey mv=move Alias Permanent for All Users Create a Batch File for the Alias: Open a text editor (e.g., Notepad).

Add the following lines:

@echo off
doskey mv=move $*

Save the file as aliases.bat in a directory accessible to all users, such as C:\aliases.bat.

Ensure the file has appropriate permissions so all users can read it (default permissions are usually fine for a folder like C:).

Modify the Registry for All Users: Open the Registry Editor: Press Win + R, type regedit, and press Enter.

If prompted by User Account Control (UAC), click Yes to proceed (administrative privileges are required).

Navigate to the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor

Check for an AutoRun entry: In the right pane, look for a string value named AutoRun.

If it doesn’t exist, right-click in the right pane, select New > String Value, and name it AutoRun.

Set the AutoRun value: Double-click the AutoRun entry.

In the Value data field, enter "C:\aliases.bat".

If the AutoRun key already has a value (e.g., for other commands), append your batch file path using the & operator (e.g., existing_command & "C:\aliases.bat").

Click OK.

Reboot, re-authenticate, as respective user, open cmd.exe, and test new alias.

Close the Registry Editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment