• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 520
  • Last Modified:

Change start in path for command prompt

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
crash1624
Asked:
crash1624
  • 5
  • 4
  • 3
  • +1
3 Solutions
 
Steve KnightIT ConsultancyCommented:
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
 
crash1624Author Commented:
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
 
ReneGeCommented:
start "title" /D %windir% "program.exe"
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Bill PrewCommented:
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
 
crash1624Author Commented:
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
 
Steve KnightIT ConsultancyCommented:
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
 
Bill PrewCommented:
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
 
crash1624Author Commented:
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
 
ReneGeCommented:
@crash1624
Could you please specify what tool you are using?
0
 
crash1624Author Commented:
I got it figured out.  Thanks for the replies.
0
 
Steve KnightIT ConsultancyCommented:
What did you discover then in case anyone else looks here.

Steve
0
 
ReneGeCommented:
Also, I still would like to know what is the MSP tool you are using. It may become handy!!

Thanks
0
 
crash1624Author Commented:
It ended up being a separate permissions issue.  The MSP tool I'm using is Labtech 2011.2
0
 
ReneGeCommented:
Thanks crash!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 5
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now