aa2zz6

Writing from one sub directory to another

5 posts in this topic

#1 ·  Posted (edited)

I have a main folder that holds 2 sub directories. The main folder script calls scripts from sub folder. The sub folder with the scripts needs to write a log to the second sub folder that tracks the processes. I don't know how to get out of a sub directory folder and write in another

Global $sLogFile = @ScriptDir & '\Log Directory\Log Sheet.log'

If $CmdLine[0] = 1 Then $sLogFile = $CmdLine[1]

_FileWriteLog($sLogFile, "File Path: " & $FilePath & @CRLF)

 

Edited by aa2zz6

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I have a main folder that holds 2 sub directories. The main folder script calls scripts from sub folder. The sub folder with the scripts needs to write a log to the second sub folder that tracks the processes. 

 

Edited by aa2zz6

Share this post


Link to post
Share on other sites
21 minutes ago, jguinch said:

I don't understand what is your problem.
If you want to access a relative path from your script, you can use this :

$logfile = @ScriptDir & "\..\subfolder2\file.log"

 

Oh I didn't realize "\..\" meant go back 1 directory.

Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now