Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

There are some workarounds out there to start cmd.exe as administrator in a specific path. But the problem persists for any link. For example, when starting MatLab it changes to the path in the "Start in" setting.

When starting MatLab as administrator, it always changes to %systemroot%/system32. This is not only annoying, but sometimes if you forget about this and you start other programs, log files or other outputs are written to a system critical path.

Is there any way to enable the administrator to use the "Start in" setting?

share|improve this question
    
I just created a small console program which just prints the current working directory. I does print the directory I specified in 'Start in' regardless whether I started it as normal user or elevated. Do you have other examples where this is a problem? I don't know MatLab, but why would you ever need to run this elevated? If it lets you start other programs, that's another reason not to run it elevated. –  Peter Hahndorf Oct 24 '13 at 17:04
    
Tried it and it does the same here. It seems that MatLab uses different settings for normal or admin users, and I just don't find where it takes them from. I don't have other examples. And it is only a problem for older MatLab versions, that by default want to start in a working directory located in the program folder, where Win7/8 doesn't allow to write. I solved it by using a small startup script that changes the path. Thank you for your answer. –  Heiko Oct 28 '13 at 10:02

1 Answer 1

One thing I can think of is to write a batch file which changes the working directory and run your program, and then start that batch file as Administrator.

Make a file runprog.cmd with this content and place it somewhere:

@echo off
cd C:\some\path
some_program.exe

Then create a shortcut to it and change to your icon. This should work.

share|improve this answer
    
I haven't tested this since I don't have a PC at the moment. –  Alvin Wong Oct 24 '13 at 16:34
    
Thanks for answering. I solved the problem in MatLab internally, by using a startup script. But I still don't understand why MatLab thinks it should change to System32. I don't find this setting. Still, consider the topic as solved. –  Heiko Oct 28 '13 at 10:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.