Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

cmd.exe (WIHU started over UNC-Path)

- - - - -

  • Please log in to reply
9 replies to this topic

#1
opensurf

opensurf

    Newbie

  • Member
  • 22 posts
when i start WIHU with an UNC-Path and the started program within WIHU is cmd.exe,

...
; Sub command 1
description.1=Windows Media Player 9 (+ Hotfix Q819639, Q828026, Q837272)
command.1=cmd.exe /c %WIHU%\Windows\wmp\setup.cmd
file.1.0=%SystemRoot%\System32\wmp.dll?9.0.0.3128
...


i get the following errormessage in the DOS-Environment:
CMD.EXE wurde mit "\\hostname\share\WIHU" als aktuellem Verzeichnis gestartet.
UNC-Pfade werden nicht unterst├╝tzt.
Stattdessen wird das Windows-Verzeichnis als aktuelles Verzeichnis gesetzt.
It's possible to start cmd.exe with %TEMP% if WIHU is started with UNC-Path?

Thx


How to remove advertisement from MSFN

#2
BenjaminKalytta

BenjaminKalytta

    Developer

  • Member
  • PipPipPipPip
  • 609 posts
No it seems not as this is an error message by cmd.exe whichs says that this isn't possible.

Benjamin

#3
opensurf

opensurf

    Newbie

  • Member
  • 22 posts
i have less experience in programing, but isn't it possible to check the Cmd if it start's with cmd.exe and if yes, then replace CurDir with %TEMP%?

wihu.c:
...
if (LogonWithNewName == 0) {
/* Install as current user (i.e. Administrator) */
Result = CreateProcess(NULL, Cmd, NULL, NULL, FALSE, 0, 0, CurDir, &sti, &pi);
} else {
Result = CreateProcessWithLogonW(UserName, NULL, UserPassword, LOGON_WITH_PROFILE, NULL, Cmd, 0, NULL, CurDir, &sti, &pi);
}
...

#4
BenjaminKalytta

BenjaminKalytta

    Developer

  • Member
  • PipPipPipPip
  • 609 posts
Everything is possible, but I won't add too much special features ... btw. why should %curdir% replaced by %temp% ?

Benjamin

#5
opensurf

opensurf

    Newbie

  • Member
  • 22 posts
%temp% is only an example. Best solution would be a startdirectory for every command or a general startdir for all commands.

Only for cmd.exe would a startdir be nice, because of ugly startmessage.

Thx

#6
BenjaminKalytta

BenjaminKalytta

    Developer

  • Member
  • PipPipPipPip
  • 609 posts
Ah now I understand your problem ... what kind of message is this? Messagebox?

Benjamin

#7
opensurf

opensurf

    Newbie

  • Member
  • 22 posts
inside the started cmd.exe (first three lines) i get the following messages:
CMD.EXE wurde mit "\\hostname\share\WIHU" als aktuellem Verzeichnis gestartet.
UNC-Pfade werden nicht unterst├╝tzt.
Stattdessen wird das Windows-Verzeichnis als aktuelles Verzeichnis gesetzt.


#8
Alanoll

Alanoll

    CODE tags people, CODE tags!

  • Patrons
  • 5,496 posts
what you could do instead, is mount the UNC path as a drive letter (Z: for example).
Welcome to the Forum! Please READ Me!!
Alright, that's it for the site for now. Now on to the next project....which could concievable replace the current site :)

#9
the_spide

the_spide
  • Member
  • 2 posts
I submitted a patch for this...

If (or when) it gets added to the main branch it will be possible to specify in the ini file what path to start the application in using "startin.<number>=<path>"

Hopefully it should fix your problem.

eg:
[Development]
command.0=cmd.exe
description.0=Command Prompt - wihu path (default, reverse compatable)
selected.0=1

command.1=cmd.exe
startin.1=.
description.1=Command Prompt - Relitive to install.ini file
selected.1=1

command.2=cmd.exe
startin.2=C:\
description.2=Command Prompt - Fixed Path
selected.2=1

command.3=cmd.exe
startin.3=%HOMEDRIVE%%HOMEPATH%
description.3=Command Prompt - Enviroment (C:\Documents and Settings\<Username>)
selected.3=1


#10
BenjaminKalytta

BenjaminKalytta

    Developer

  • Member
  • PipPipPipPip
  • 609 posts
Thx at the_spide for his suggestion and patch. I added "WorkDir.x" key which could be used here to specify working directory.
Please note, relative directories are relative to WIHU application directory!
You may use %INIDIR% or %CURDIR% varaible to override this.

Benjamin




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN