?
Solved

Change start in path for command prompt

Posted on 2011-10-27
14
Medium Priority
?
516 Views
Last Modified: 2012-05-12
Hello,

I need to change the start in path for command.exe using either a registry edit, script or command prompt command.  I have a remote tool that uses shell as admin and XP machines can't run as admin with the start in path being the user's home directory.  Thanks in advance for any tips.
0
Comment
Question by:crash1624
  • 5
  • 4
  • 3
  • +1
14 Comments
 
LVL 43

Expert Comment

by:Steve Knight
ID: 37039184
you can change the default in registry but that is likely to be user profile dir on c: pr windows system drive or in shortcut set the working dir.  if they start the app from a shortcut on their desktop amend it there.

if not how are you running this tool, is it from batch file?  If so you can just do:

@echo off
cd /d "%temp%"
start "Your app name" runas.exe /user:administrator yourapp.exe

etc.  say to set the path to the temp drive
0
 

Author Comment

by:crash1624
ID: 37039278
Sorry I don't mean the default working directory in cmd.  I need to change the start in directory.  If you open properties on the cmd file it'll show the "start in" directory, I need to be able to change this to a system wide variable like %windir%.  I need to do this through the registry or through the command prompt itself.
0
 
LVL 10

Assisted Solution

by:ReneGe
ReneGe earned 600 total points
ID: 37039494
start "title" /D %windir% "program.exe"
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
LVL 59

Assisted Solution

by:Bill Prew
Bill Prew earned 600 total points
ID: 37040272
Here's the registry approach to this.  I won't steal it and try to make it look like I created it, but here's the link:

http://www.techtalkz.com/windows-98-2000-me-xp-2003-vista/486250-how-change-default-startup-directory-command-prompt.html#post1943492

~bp
0
 

Author Comment

by:crash1624
ID: 37040832
I'm not looking to change the target or the startup directory.  I need to change the start in path to %windir%.  If you go to properties of cmd.exe you'll see what I mean.  Thanks for the comments so far.
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 800 total points
ID: 37040966
So you want to change the Shortcut in the Start menu ?

I hadn't noticed but yes on this Win7 box it is "%HOMEDRIVE%%HOMEPATH%" for instance.  You could always delete the command prompt icon and then copy a new one in?

On my Win7 box it seems it is at:

C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories
or %appdata%\Microsoft\Windows\Start Menu\Programs\Accessories

and on XP is likely to be %userprofile%\start menu\accessories or the all users profile.
Steve
0
 
LVL 59

Expert Comment

by:Bill Prew
ID: 37041338
I'm confused.  I thought you were running CMD.EXE from a remote system, through a command line?  If so, then that won't look at the shortcut where you are seeing that "Start in:" text box.

~bp
0
 

Author Comment

by:crash1624
ID: 37045173
billprew, I am running shell as admin remotely using an msp tool.  It runs scripts and shell commands as admin under the currently logged in user's profile.  
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 37045732
@crash1624
Could you please specify what tool you are using?
0
 

Author Comment

by:crash1624
ID: 37045751
I got it figured out.  Thanks for the replies.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 37045792
What did you discover then in case anyone else looks here.

Steve
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 37046367
Also, I still would like to know what is the MSP tool you are using. It may become handy!!

Thanks
0
 

Author Comment

by:crash1624
ID: 37046388
It ended up being a separate permissions issue.  The MSP tool I'm using is Labtech 2011.2
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 37046462
Thanks crash!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question