Page 1 of 1 1
Topic Options
#15441 - 2001-12-20 09:50 PM Boy do I feel stupid! directories question
debrian Offline
Lurker

Registered: 2001-11-28
Posts: 4
How do you traverse back up a directory structure? ie from c:\windows\temp back to c:\windows
Top
#15442 - 2001-12-20 09:57 PM Re: Boy do I feel stupid! directories question
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Do you mean like at the DOS prompt?

CD..

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#15443 - 2001-12-20 10:17 PM Re: Boy do I feel stupid! directories question
debrian Offline
Lurker

Registered: 2001-11-28
Posts: 4
no within a kix script
Top
#15444 - 2001-12-20 10:35 PM Re: Boy do I feel stupid! directories question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
code:

$directory='c:\windows\temp'
$directory=left($directory,instrrev($directory,'\')-1)

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

Top
#15445 - 2001-12-21 01:42 AM Re: Boy do I feel stupid! directories question
J-me Offline
Fresh Scripter

Registered: 2001-12-20
Posts: 21
Loc: Denver CO
just use the cd command
cd ".."

Top
#15446 - 2001-12-21 01:59 AM Re: Boy do I feel stupid! directories question
debrian Offline
Lurker

Registered: 2001-11-28
Posts: 4
OK let me a level of complexity since it is not as simple as cd..

I am trying to write a script that uses winzip command line to zip up evt files that have been archived to a different server, and name the .zip with the current month and year. Here is the code.

code:

Break on
$m=@MONTH
$y=@YEAR
$arc="archive00"
Dim $servers[3]
$servers="server1","server2","server3","server4"
For Each $Element In $servers
$serv=$Element
Use x: "\\logserver\archive" @ERROR
Go x: @ERROR
Cd $serv @ERROR
Cd $arc @ERROR
Dim $target[2]
$target="application","system","security"
For Each $element In $target
$folder=$element
Cd $folder
Run "%comspec% /c wzzip -ybc $y$m-system.zip" @ERROR


Top
#15447 - 2001-12-21 02:12 AM Re: Boy do I feel stupid! directories question
debrian Offline
Lurker

Registered: 2001-11-28
Posts: 4
Thanks J me it worked. I never thought to put it in quotes.
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 1292 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.114 seconds in which 0.081 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