Page 1 of 1 1
Topic Options
#174275 - 2007-02-26 08:02 PM Run as... current directory [start in]
alphagetti666 Offline
Fresh Scripter

Registered: 2007-02-23
Posts: 7
Loc: Canada
I have a number of scripts that are predominate DOS but a growing number of kix scripts... most of which are started by a dos batch. On vista, some need to be initiated as administrator. When the scripts are run, the current directory [as shown by CD] changes... it is not the "start in" path.

Any way of fixing this? I do not want to add the script to the PATH because we where it is initiated from, has different effects.

Thanks.

Top
#174307 - 2007-02-27 10:26 AM Re: Run as... current directory [start in] [Re: alphagetti666]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
 Quote:
Any way of fixing this


Not really. When you change the user context the path is invalidated, and you switch to a default path.

There are a couple of work-arounds.
  1. Pass the "start in" path to the script and change directory at the start of the script.
  2. For KiXtart, use the @SCRIPTDIR variable rather than relying on the current working directory to determine the context that the script is running in.


If you are changing user context, make sure that you only ever use UNC for the path names for network drives - if you use a mapped drive letter it will probably become invalid when the user changes context.

Top
#174317 - 2007-02-27 05:47 PM Re: Run as... current directory [start in] [Re: Richard H.]
alphagetti666 Offline
Fresh Scripter

Registered: 2007-02-23
Posts: 7
Loc: Canada
Ug... oh well... that should work I guess.. thanks for the tip.
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1171 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.052 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org