Sign in to follow this  
Followers 0
Guest blackhawk

Function current path

10 posts in this topic

Hello,

I´m searching for a funktion, which i can find out the current path of the file.

Share this post


Link to post
Share on other sites



Hello,

I´m searching for a funktion, which i can find out the current path of the file.

<{POST_SNAPBACK}>

@ScriptFullPath
eg. "C:\Temp\test.txt"

@ScriptDir
eg. "C:\Temp\"

this should be in the suport forum btw :lmao:


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

the path should be variable.

example:

a user save the files on his desktop.

The script should copy the file from the current path (which must be variable) to

an fix path (c:\temp)

and another user could nsave the file in c:

then the script must copy the file from c: to c:\temp.

Share this post


Link to post
Share on other sites

What file? The AutoIt script, a file you select from the script, or something else? Might wanna have a poke in the help file at the File* functions under Function Reference->File, Directory and Disk Management to see if anything there gives you inspiration and post whatever script you have so far.

Share this post


Link to post
Share on other sites

yes a file that i select from the script.

Share this post


Link to post
Share on other sites

Take a look at FileOpenDialog - does this help?

Share this post


Link to post
Share on other sites

where can i find this ?

Share this post


Link to post
Share on other sites

Open the help file... read some stuff... try some things out... then come here when you have problems...

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

we need a way to make people read the whole help file before coming here (jk)

use this

$file = FileOpenDialog ( "title", "default dir", "filter (*.*)" )
FileCopy ( $file, "C:\temp" )

ta-da!

EDIT: let me correct myself

we need a way to FORCE people to read the whole help file before coming here

jk of couse :lmao: Edited by Xenogis

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites

Try this one.

$file = FileOpenDialog ( "title", "default dir", "filter (*.*)" )
;FileCopy ( $file, "C:\temp" )
$Folder = _GetFolder($file)
MsgBox(64, "Test", "The folder of the selected file:" & @CRLF & $Folder)

Func _GetFolder($gFile)
   Local $Match
   $Match = StringInStr($gFile, "\", 0, -1)
   Return StringLeft($gFile, $Match - 1)
EndFunc

BTW, you can select a folder y'know using a function: FileSelectFolder()

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
Sign in to follow this  
Followers 0