jax157 Posted April 19, 2013 Share Posted April 19, 2013 I need to be able to locate a file in ANY folder that has a certain file extension, and then delete that extension, and then move the file to a certain network location. What is the script to do that? Thanks in advance for your help! Link to comment Share on other sites More sharing options...
jax157 Posted April 19, 2013 Author Share Posted April 19, 2013 Also, is it possible to drag and drop the .au3 file into the folder I need, and have it automatically run the script, and then delete itself from that folder? Hope that makes sense.... Link to comment Share on other sites More sharing options...
Nessie Posted April 19, 2013 Share Posted April 19, 2013 Please show your code so we can help you Hi! My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s). My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all! My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file Link to comment Share on other sites More sharing options...
jax157 Posted April 19, 2013 Author Share Posted April 19, 2013 Please show your code so we can help you Hi!I do not have any code....hoping for that here. This is a muti-times per day task that I am looking to speed up. Link to comment Share on other sites More sharing options...
abberration Posted April 19, 2013 Share Posted April 19, 2013 If you are trying to do something in one directory then something in another directory without leaving code in the previous one, then you might want to look at FileChangeDir in the help file.If we knew exactly what the final goal you are trying to accomplish, it would help us understand. You will get more help if you are more descriptive. Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
Nessie Posted April 19, 2013 Share Posted April 19, 2013 I do not have any code....hoping for that here. This is a muti-times per day task that I am looking to speed up.Sorry but we don't write code on commission. Maybe take a look on Rent a CoderHi! My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s). My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all! My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file Link to comment Share on other sites More sharing options...
guinness Posted April 19, 2013 Share Posted April 19, 2013 Search for RecFileListToArray in the examples section. May I also suggest reading the help file that comes with AutoIt. Good luck. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 19, 2013 Moderators Share Posted April 19, 2013 jax157,As you have probably noticed by now, no-one here is too keen to help the "code it for me" brigade. We work more on the "Give a man a fish, you feed him for a day; give a man a net and you feed him forever" principle - basically we try to be net makers and repairers, not fishmongers. What you want to do is very simple. Look at the RecFileListToArray UDF in my sig - that will find the file for you. FileMove will then let you rename and move the file in one go. As to the request in your second post, I am afraid that I do not really understand what you want to do - you can run an AutoIt script from any location and use a choice dialog to set the folder in which you want to start the search. So I do not see why you would want to "drag'n'drop" and then delete the script - it would make more sense to keep it, particularly as you say this procedure is required several times a day. Take a look at the UDF and the function I mentioned and see what you can come up with - we are very ready to help if you make some effort yourself first. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jax157 Posted April 19, 2013 Author Share Posted April 19, 2013 OK....I am understanding how this works. To give some background...I have never "coded" anything before. (unless you count a macro in m-word that did a simple find-and-replace, and I copied and pasted that code from an online post....cheating, I know) However, I am not afraid to wade into the weeds and give things a try. I will be looking into everyone's ideas and examples and will be posting the results.As to the details and specifics of what I am trying to accomplish:I am operating CNC machining centers. When I create a CNC program (nothing more than lines of text), I use CAM software that allows me to create toolpaths based on 3D CAD data (3D Models), and then the CAM software post-processes the toolpaths into a code format (G-Code) that the CNC machine control can read and execute.When the post-processing happens, the CAM software creates the code file with a proprietary file extension. BUT, the machine control can't read that extension, so I have to delete it, leaving it with NO extension. This is the first task I want the autoit script to do.Next, I must send the file to the hard drive on the machine control. The machine control is connected via CAT-5 to our shop network, and therefore is a network place. And so I right-click the file, select SEND TO, and then click on the machine control on the list, and off it goes out to the machine for execution. This copying of the file from the job folder where it was saved out to the machine control is the second task I want the script to accomplish.Third, the files aren't necessarily in the same location every time. Each different job we are working on has it's own job folder, so I wanted the ability for the code to be dragged into any folder, find the file, remove the extension, send it to the machine control, and then move itself from that folder to a common location....say my desktop.I hope I make sense to you, and that this clarifies my goals. it sounds like some of the script examples above address these tasks, and I will be trying them out.Thanks again for your help and patience. Looking forward to flinging out the "net" Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 19, 2013 Moderators Share Posted April 19, 2013 (edited) jax157,I coded something very similar for a high-speed carpentry router a few years ago, so what you want is eminently doable with AutoIt. As I suggested above, I see no reason to drag the code to the relevant folder - you can use the FileSelectFolder dialog to set a base folder for the search and keep the script in a central location. I have changed your status so that you can use the PM system. As the work I did before was proprietary I cannot post it on the open forum, but we might be able to come to an arrangement for some private "net-flinging" classes - standby for incoming. M23Edit: PM sent. Edited April 19, 2013 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
AZJIO Posted April 19, 2013 Share Posted April 19, 2013 jax157 My other projects or all Link to comment Share on other sites More sharing options...
jax157 Posted April 23, 2013 Author Share Posted April 23, 2013 Ok, did some testing and here's what I got so far: ; Script Start - Add your code below here ; Shows the filenames of all files in the current directory. Local $search = FileFindFirstFile("*.tap*") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 Local $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File:", $file) WEnd ; Close the search handle FileCopy("C:UsersComputer UserDocuments*O9500.tap*" , "ftp://1XI@192.168.1.253/") As you can see, I wanted to locate any file that has the .tap extension...did that. Next, I wanted to copy that file from it's location to a different location on my C drive....did that no problem. (the code is identical as above except there is a different target location) Next, I wanted to copy that file to a network location, which you see the code for above....did NOT do that What am I doing wrong? Thanks in advance for your help! -J157 Link to comment Share on other sites More sharing options...
Nessie Posted April 23, 2013 Share Posted April 23, 2013 (edited) Take a look to _FTP_Connect and its related function expecially _FTP_FilePut. Hi! Edited April 23, 2013 by Nessie My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s). My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all! My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file Link to comment Share on other sites More sharing options...
jax157 Posted April 23, 2013 Author Share Posted April 23, 2013 Ok, I've been trying the FTP commands, but not sure what goes first..._FTP_Connect...._FTP_Open....._FTP_Fileput? What is the correct order? Thank you! Link to comment Share on other sites More sharing options...
Nessie Posted April 23, 2013 Share Posted April 23, 2013 An express example: #include <FTPEx.au3> $host = 'host' $username = 'Username' $pass = 'Password' $open = _FTP_Open('FTP Uploader') $connect = _FTP_Connect($open, $host, $username, $pass) _FTP_FilePut($connect,@DesktopDir & "\test.txt","/test.txt") $close = _FTP_Close($open) Hi! My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s). My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all! My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now