Jump to content

Function current path


Guest blackhawk
 Share

Recommended Posts

Guest blackhawk

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.

Link to comment
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.

Link to comment
Share on other sites

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]

Link to comment
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()

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...