User Tools

Site Tools


Missing permissions for cmd.exe

Security policies on some systems restrict or do not permit the usage of the command line interpreter. If this is the case and you click on the MSDOS Icon in the GAMSIDE (in the upper right corner) you usually get a message like:

 The command prompt has been disabled by your administrator.
 Press any key to continue . . .

Also your models will most likely not work. In most cases this is caused by an entry in the Windows registry at:


The entry is called DisableCMD (Type is: REG_DWORD)

  • If it is set to 0, then the key is not present
  • If it is set to 1, the user is not allowed to start cmd.exe or use batchfiles
  • If it is set to 2, the user is not allowed to start cmd.exe but can use batchfiles

If the key is set to 1 or 2, your model will require some modifications:

  1. GAMS provides an option named solvelink to force the solver not to use the shell but rather directly spawn the solver executable. Just add the line option solvelink=2; to your model before the solve statement. Some solvers supports passing the model to the solver in memory, if the solver you are using supports this, then you can use solvelink=5.
  2. All utilities, which are using shell commands will not work. Examples are $libinclude Xlimport or $libinclude Xlexport. These utilities make use of the gdxxrw utility through shell scripts. A better way to communicate with Excel would be to use gdxxrw directly. Please make sure there is an '=' in the execute call in to avoid the execution of the shell: execute'=gdxxrw….'.
  3. GAMS deletes its scratch files using a shell script at the end of the run. We have a secondary removal step that prints out some warnings, which you can safely ignore.

A good test to verify whether such restrictions are active is to run cmd.exe and gams ? as an administrator. To do this: Search the “Command Prompt” icon → right click →Run as Administrator and execute “gams ?” in the GAMS System Directory. If the problems now disappear, please check with the IT department, whether they can relax the security restrictions for running GAMS. Some clients have reported that the steps below helped to get GAMS working in an environment with restricted user permissions (running MS Vista):

  1. Right click on the GAMS Icon on your desktop
  2. Click on the compatibility tab (left clicks from now on)
  3. Enable (check) “Run this program in compatibility mode for:
    • Select “Windows XP (Service Pack 2)”
    • Enable (check) “Run this program as a system administrator”
    • Then click on the “Apply” button
  4. Close the properties window
  5. Click on the GAMS Icon
IMPRESSUM / LEGAL NOTICEPRIVACY POLICY installation/missing_permissions_on_cmd.exe.txt · Last modified: 2017/09/02 19:27 by support