Page 1 of 1 1
Topic Options
#141028 - 2005-06-06 02:21 PM subst x: /d
bene Offline
Fresh Scripter

Registered: 2005-03-16
Posts: 13
Loc: Germany
hi@all,
in windows, there's a way to substitute a drive, e.g. subst x: %programfiles% and to "unsubst" with subst x: /d
how can i realize that with kix??? especially "unsubst"!
thx
bene

Top
#141029 - 2005-06-06 02:34 PM Re: subst x: /d
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
You cannot do this with KiXtart directly.

You will have to use SHELL to execute the DOS command:
Code:
Shell '"'+%COMSPEC%+'" /C SUBST X: /D'


Top
#141030 - 2005-06-06 02:38 PM Re: subst x: /d
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
wonder should we write udf for that...
_________________________
!

download KiXnet

Top
#141031 - 2005-06-06 05:16 PM Re: subst x: /d
bene Offline
Fresh Scripter

Registered: 2005-03-16
Posts: 13
Loc: Germany
hi guys,
it's really impressing - anytime i use this community - how fast you help solving problems. In this case, i found an easier way to reach the goal, but anyway i learned an important feature besides the "run"command.
thanks a lot!
bene

btw: what does udf mean?


Edited by bene (2005-06-06 05:17 PM)

Top
#141032 - 2005-06-06 05:19 PM Re: subst x: /d
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
udf - user defined function
a way for scripter to write custom functions to be used in scripts in addition to those that are inbuilt in kixtart.
_________________________
!

download KiXnet

Top
#141033 - 2005-06-06 05:28 PM Re: subst x: /d
bene Offline
Fresh Scripter

Registered: 2005-03-16
Posts: 13
Loc: Germany
thx. sounds good - but i don't know if more noobs would need that...
Top
#141034 - 2005-06-06 05:46 PM Re: subst x: /d
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
not really for noobs.
for those who don't like shelling...
could do a udf that does not rely on subst.
_________________________
!

download KiXnet

Top
#141035 - 2005-06-06 05:46 PM Re: subst x: /d
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
It is especially good for noobs cuz it gives them hundreds of "black box" UDFs that they don't need to code.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#141036 - 2005-06-06 10:22 PM Re: subst x: /d
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Quote:

hi guys,
.....
In this case, i found an easier way to reach the goal,
.....





And that would be? Maybe someone can benefit from your solution in the future so if you can and feel like it you can post your solution here.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#141037 - 2005-06-07 03:13 AM Re: subst x: /d
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See MapDrive() - Maps a UNC name to a specific driveletter which utilizes SUBST for Windows NT 4.0 support of pseudo-deep-mapping.
_________________________
There are two types of vessels, submarines and targets.

Top
#141038 - 2005-06-07 06:43 AM Re: subst x: /d
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Quote:

for those who don't like shelling...
could do a udf that does not rely on subst.





On NT 4 no SUBST?

I'm interested in seeing the UDF myself. Didn't know KiX had a method to eliminate SUBST for NT 4 systems.
 

Top
#141039 - 2005-06-07 01:44 PM Re: subst x: /d
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, everyday you learn something little more and when you are old, you forget it all... right?
_________________________
!

download KiXnet

Top
#141040 - 2005-06-07 03:31 PM Re: subst x: /d
bene Offline
Fresh Scripter

Registered: 2005-03-16
Posts: 13
Loc: Germany
Quote:

And that would be? Maybe someone can benefit from your solution in the future so if you can and feel like it you can post your solution here.




Of cause, i would have posted that - i think, it is not so interresting for that board. My notebook-users don't have to decide, wether they work in office or offline or somewhere else. but they all should use the benefits of softwaredeployment and filesync. so we have a kix-loginscript running by w2k3-dc-policy and a sync-script running from local registry.
working in offline-mode, the pc uses a subst to link the path for the local programs, workin in online-mode, a networkdrive should deploy programs and services for the notebooks beeing allways up to date.
the problem is: mappings from kix by dc-policy aren't established fast enough, so the script allways thought to work in offlinemode. i'm not shure, if the subst was correctly deleted on next logon, so my local script now looks something like that: delete any old subst on v: - manually map networkdrive - decide, if networkfile exist an then run offline- or online-routine ....

REM ================================
REM Local Startroutine for Notebooks
REM ================================

REM ================
REM delete old Subst
REM ================

! SUBST V: /D

NET USE V: \\%PROGSERVER%\PROG

IF EXIST V:\*special folder and file on the network* THEN GOTO ONLINE
:OFFLINE

IF NOT EXIST *special userfolder on local pc* THEN PAUSE Warning! Your personal folder doesn't exist.

REM ============
REM SUBST DRIVES
REM ============
! SUBST V: %PROGRAMFILES%

REM =====================

REM Set local NI-Variable
REM =====================
! SETX NI %PROGRAMFILES%\*Programspace*

PAUSE You are not working on the network. You can only work with files from your local personal folder.
GOTO END

:ONLINE

REM ===============
REM SYNCHRONIZATION
REM ===============

... (running online-actions here)

END

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
1 registered (Allen) and 581 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.068 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

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