Jump to content

read file extension and create folder


Wollf
 Share

Recommended Posts

i dont know how exactly i can read a files extension and create folder, is there any specific command? here's how i do it but i dont know what to write at the last folder that will send file

Filecopy(@GUI_DRAGFILE , @scriptdir & "\" & GUICtrlRead($2) & "\" & guictrlread($pic1)  & "\" & "how to read file extension?" &"\")
Link to comment
Share on other sites

what do u want to do exactly.. u want to copy the dragged file to ur specified loaction??

if that's the case.. then u can do something like this:

$dragfile='c:\bogus\toga\cool\hum.txt'; this is ur @guidragfile variable, just replace '$dragfile' with @guidragfile. 
$array=StringSplit($dragfile,"/")
$array1=stringsplit($array[$array[0]],".")
MsgBox(4096,"",$array1[2])

here u get the extn "txt" of the file..

i have just used the variable $dragfile for an example.. it will be replaced by @guidragfile..

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Link to comment
Share on other sites

what do u want to do exactly.. u want to copy the dragged file to ur specified loaction??

if that's the case.. then u can do something like this:

$dragfile='c:\bogus\toga\cool\hum.txt'; this is ur @guidragfile variable, just replace '$dragfile' with @guidragfile. 
$array=StringSplit($dragfile,"/")
$array1=stringsplit($array[$array[0]],".")
MsgBox(4096,"",$array1[2])

here u get the extn "txt" of the file..

i have just used the variable $dragfile for an example.. it will be replaced by @guidragfile..

i want it to read file extension create a folder with the name of extensions and move file in that folder. location isnt specific because the user creates the folders

Link to comment
Share on other sites

as i told u my script above tells u the extension..

Now simply give it as a name to the folder.. create new folder by.. DirCreate.. specify the location u want..

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
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...