Custom Shell working directory

Y

Yabbie

Hello,

Is there a way you can set the working directory of a custom shell ?

For example: My custom shell resides in C:\x\myShell.exe, but because it is
a shell, the working directory *seems* to be set to the system32 directory.
myShell.exe needs some other files in c:\x, but can't find them since the
working directory is incorrect. It is not an option to move all the files
in c:\x into the system32 directory.

Any help would be much appreciated.
 
K

KM

Yabbie,

Do you have access to your custom shell app sources? If you do, you can use
SetCurrentDirectory win API to set the working directory you need.
If you don't, you can make a separate small app to call SetCurrentDirectory
and then launch your shell app (CreateProcess, ShellExecute[Ex]).

KM
 
K

Kesavan

Yabbie Y dont u have a stub.exe or something in your system32 that
directs to the path where your shell exists.
 
Y

Yabbie

Hello again everyone.

Firstly, thanks for all the advice.

Kesavan, I thought about a stub.exe, but to me at least, that seems like a
hack, surely there is a nicer way ?

My latest attempt was to put a shortcut in the startup section of the start
menu, but as I suspected Minlogon doesn't seem to support that.

Anyone from MS have anything to add ???
 
K

KM

Yabbie,

What startup section do you refer to? Minlogon image does not support
regular user accounts and I don't think there is any startup items supported
(like "Documents and Settings\<(all) user profile>\Start
Menu\Programs\Startup").

Also, having your shell app to handle startup items does not seem to be a
hack but should be considered by design since you make you custom app as the
shell.

KM

Y> Hello again everyone.

Y> Firstly, thanks for all the advice.

Y> Kesavan, I thought about a stub.exe, but to me at least, that seems
Y> like a hack, surely there is a nicer way ?

Y> My latest attempt was to put a shortcut in the startup section of the
Y> start menu, but as I suspected Minlogon doesn't seem to support that.

Y> Anyone from MS have anything to add ???



With best regards, KM. E-mail: (e-mail address removed)
 
Y

Yabbie

Hi KM,

The startup section I refered to is the same one you highlighted, but like I
said, I suspected that wouldn't work.

Here is my situation in a little more detail. My company has written an
application that currently runs on Windows 2000. It is just a regular
program, not a shell or anything. I am investigating the possibility of
moving to XPe. I want our program to become the shell using minlogon if
possible, but I don't want to have to modify our application to do this.

Is this possible ? If not, what is involved in making a 'shell' application
as opposed to a 'regular' application ?

The thing holding me back at the moment, is the application accesses files
in various directories below the "bin" directory. Since the custom shell
(our app) *seems* to run in the system32 directory, it complains it can't
find the required directories. If I could change the working directory of
the custom shell (but NOT in the application itself), I'd be laughing.

Any further suggestions ?

Thanks,
Brad (Yabbie)
 
S

Slobodan Brcin

You will have to use some simple application that will be started as shell.
This application could use CreateProcess to set default folder and start
your application.

Or you can try to use bat file instead of simple application for same
purpose.

Regards,
Slobodan
 
K

KM

Yabbie,

I don't think you would be able to change the working directory from
%Systemroot%\system32. I guess that is by design since winlogon.exe
(winlogon/minlogon) running from there and does not change the working
directory inside. There is no a registry value like "working dir" on the
same level as a shell exe ([HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Winlogon\"Shell"]) either.

As being said, you most likely need to create your own app (a very simple
one, just to call SetCurrentDir and CreateProcess) that will be considered
as a shell and will launch your company's application (and whatever you need
more). Your "small" app does not have to have any GUI, I think.

As Slobodan pointed out opportunely, you may use a .bat (or .cmd) file
instead of the "small exe" mentioned above. However, this way you gain a
side effect - end user may see a command prompt window appearing on the
screen ("blinking the screen" for a quick time) at the boot time.

Good luck,
KM

Y> Hi KM,

Y> The startup section I refered to is the same one you highlighted, but
Y> like I said, I suspected that wouldn't work.

Y> Here is my situation in a little more detail. My company has written
Y> an application that currently runs on Windows 2000. It is just a
Y> regular program, not a shell or anything. I am investigating the
Y> possibility of moving to XPe. I want our program to become the shell
Y> using minlogon if possible, but I don't want to have to modify our
Y> application to do this.

Y> Is this possible ? If not, what is involved in making a 'shell'
Y> application as opposed to a 'regular' application ?

Y> The thing holding me back at the moment, is the application accesses
Y> files in various directories below the "bin" directory. Since the
Y> custom shell (our app) *seems* to run in the system32 directory, it
Y> complains it can't find the required directories. If I could change
Y> the working directory of the custom shell (but NOT in the application
Y> itself), I'd be laughing.

Y> Any further suggestions ?

Y> Thanks,
Y> Brad (Yabbie)


Y>>> Hello again everyone.

Y>>> Firstly, thanks for all the advice.

Y>>> Kesavan, I thought about a stub.exe, but to me at least, that seems
Y>>> like a hack, surely there is a nicer way ?

Y>>> My latest attempt was to put a shortcut in the startup section of
Y>>> the start menu, but as I suspected Minlogon doesn't seem to support
Y>>> that.

Y>>> Anyone from MS have anything to add ???





With best regards, KM. E-mail: (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top