Page 1 of 1 1
Topic Options
#36385 - 2003-02-12 01:44 PM @WKSTA (how to create multiple directories with @wksta as one of them)
Mike Duhwald Offline
Fresh Scripter

Registered: 2003-01-13
Posts: 40
Hi,
I want to create a directory with the following line:

MD $strDrive + "\Test\Test123\Log\@WKSTA"

How must I modify the script that the directory created is named after the workstation???

Regards
Mike

(MCA: complete subject)

[ 14. February 2003, 19:00: Message edited by: MCA ]

Top
#36386 - 2003-02-12 04:53 PM Re: @WKSTA (how to create multiple directories with @wksta as one of them)
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
code:
$folder=$strDrive + '\Test\Test123\Log\'+@WKSTA
md $folder

_________________________
There are two types of vessels, submarines and targets.

Top
#36387 - 2003-02-12 05:27 PM Re: @WKSTA (how to create multiple directories with @wksta as one of them)
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
I'm guessing that you want to create it only if it doesn't already exist... [Smile]
code:
$folder=$strDrive + '\Test\Test123\Log\'+@WKSTA
If Exist ($folder) = 0 ; if it's not there
md $folder
If @error <> 0 ; if failed to make
? "Error making folder "+@error+" "+@serror
Endif
Endif

_________________________
We all live in a Yellow Subroutine...

Top
#36388 - 2003-02-12 05:49 PM Re: @WKSTA (how to create multiple directories with @wksta as one of them)
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Ah well ... there was an update of COPY command functionality to create a folder if not existant in one of the 4.20 releases, no ?

J.
_________________________



Top
#36389 - 2003-02-12 05:53 PM Re: @WKSTA (how to create multiple directories with @wksta as one of them)
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Yes, if the folder(s) you are copying to do not exist they will be created automatically.
_________________________
There are two types of vessels, submarines and targets.

Top
#36390 - 2003-02-14 07:05 PM Re: @WKSTA (how to create multiple directories with @wksta as one of them)
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

For earlier kixtart versions you can use

code:
IF (Exist($strDrive+"\Test") = 0) ; if it's not there   
MD $strDrive+"\Test"
IF (@error <> 0)
? "Error KIX-MD: problems with making folder. error code @error (@serror)"
ENDIF
IF (Exist($strDrive+"\Test\Test123") = 0)
MD $strDrive+"\Test\Test123"
ENDIF
IF (Exist($strDrive+"\Test\Test123\Log") = 0)
MD $strDrive+"\Test\Test123\Log"
ENDIF
IF (Exist($strDrive+"\Test\Test123\Log\@wksta") = 0)
MD $strDrive+"\Test\Test123\Log\@wksta"
ENDIF
ENDIF

greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

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 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.188 seconds in which 0.134 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