Page 1 of 1 1
Topic Options
#144718 - 2005-08-03 07:11 PM Change Directory
Maik Offline
Getting the hang of it

Registered: 2003-01-14
Posts: 87
Hello,
how can I change the directory I am currently into?

I am now in @scriptdir\scripts and want to go into @scriptdir\documents which lies on the same level. Is there any macro?

Maik

Top
#144719 - 2005-08-03 07:24 PM Re: Change Directory
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
cd "..\documents" ?
Top
#144720 - 2005-08-03 07:25 PM Re: Change Directory
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
You could use KiX's CD command...

Code:

CD @SCRIPTDIR + "\documents "
@ERROR " | " @SERROR ?



Edited by Chris S. (2005-08-03 07:25 PM)

Top
#144721 - 2005-08-03 07:58 PM Re: Change Directory
Maik Offline
Getting the hang of it

Registered: 2003-01-14
Posts: 87
Chris,
I must start applications in the desired folders. Is it possible to call them without using "CD" to change in this directory?

Maik

Top
#144722 - 2005-08-03 10:28 PM Re: Change Directory
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Run "..\documents\MyProgram.exe"
Top
#144723 - 2005-08-03 10:30 PM Re: Change Directory
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Witto,
That does not change the current "working" directory.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#144724 - 2005-08-03 10:58 PM Re: Change Directory
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
True. I think you have to change directory for a short while.
Code:

Dim $strPath
$strPath = @CURDIR
CD "..\documents"
Run "MyProgram.exe"
CD $strPath


Top
#144725 - 2005-08-03 11:19 PM Re: Change Directory
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Quote:

Is it possible to call them without using "CD" to change in this directory?



You don't say if you need sync or async but ShellExecute could be your friend.

http://msdn.microsoft.com/library/defaul...hellexecute.asp
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#144726 - 2005-08-04 12:55 AM Re: Change Directory
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
that shellExecute won't work.
but here is some code to try:
Code:

$shell=createobject("shell.application")
if @error
"error: " @error " - " @serror
exit 1
endif
$shell.shellexecute("c:\winnt\notepad.exe","c:\boot.ini /p","c:\temp",,1)


http://msdn.microsoft.com/library/en-us/...hellexecute.asp

but still.
this is not what he actually asked.
he asked how to change the directory, and answer to that is by CD.

then he said, how can he change directory without changing the directory.
blaah.
at that point he should think again what he is asking.
_________________________
!

download KiXnet

Top
#144727 - 2005-08-04 03:54 AM Re: Change Directory
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
What can I say? Think he's paddling with just one oar.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#144728 - 2005-09-26 10:17 PM Re: Change Directory
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Eh Jooel, thanks for the link. With it, I was able to specify the directory.

Code:
break on
;run "%comspec% /c start dir c:\"
$sCMD = %COMSPEC%
$sDir = "C:\Program Files"
$sParms = ' /c Start "TapeCopyCMD" dir c:\'
$oShell = CreateObject("Shell.Application")
$oFolder = $oShell.ShellExecute($sCMD,$sParms,$sDir,"",1)

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

Top
#144729 - 2005-09-26 11:27 PM Re: Change Directory
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
with the link?
so, my example code was not clear enough?
_________________________
!

download KiXnet

Top
#144730 - 2005-09-27 03:56 AM Re: Change Directory
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Ja, not clear enough. Your example did not explain the parms. The link did.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

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

Generated in 0.163 seconds in which 0.129 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