Chimaera Posted June 23, 2015 Posted June 23, 2015 Im trying to backup a folder that belongs to a wamp serverC:\wamp\bin\mysql\mysql5.6.17\databut the problem is this bitmysql5.6.17its a shame i cant do thismysql*\data for every version of mysql the numbers change so i cant get a definitive address for the backupIve searched and rechecked all my saved stuff but im surprised that i cant find anything suitableis there a simple way to get the destination? If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices()
pcjunki Posted June 23, 2015 Posted June 23, 2015 what's your code?couldn't you use dircopy?DirCopy("c:\wamp\bin\mysql", "c:\backup")
Moderators JLogan3o13 Posted June 23, 2015 Moderators Posted June 23, 2015 Why not do a _FileListToArray, and then hit on any directories matching your criteria? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
iamtheky Posted June 23, 2015 Posted June 23, 2015 (edited) you could let Dir fill out the wildcard, then use the return, of course this relies on there being no risk of multiple matches. #include <Constants.au3> $sPath = "C:\Program Files (x86)\" $sWildDir = "AutoIt*" $sFile = "Au3Info.exe" Local $iPID = Run(@ComSpec & ' /c dir /B "' & $sPath & $sWildDir & '"', @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $sOutput = "" While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd $sFullSrc = $sPath & stringstripws($sOutput , 2) & "\" & $sFile filecopy($sFullSrc , @ScriptDir & "\backup_" & $sFile) Edited June 23, 2015 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Chimaera Posted June 24, 2015 Author Posted June 24, 2015 (edited) what's your code?couldn't you use dircopy?DirCopy("c:\wamp\bin\mysql", "c:\backup")No because i dont want the lower directories only the data oneWhy not do a _FileListToArray, and then hit on any directories matching your criteria?I had a look with FileListToArrayRec but couldnt isolate it down to just the one folder i needSo i ended up like this from Boththose suggestion#include <Constants.au3> $sPath = "c:\wamp\bin\mysql\mysql*" Local $iPID = Run(@ComSpec & ' /c dir /B "' & $sPath & '"', @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $sOutput = "" While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd $sOutput = 'c:\wamp\bin\mysql\' & StringStripWS( $sOutput, 2) & '\data' ConsoleWrite( $sOutput & @CRLF)Which appears to work for me and gives this outputc:\wamp\bin\mysql\mysql5.6.17\datawhich is the dir im after. Many thanks for the help Edited June 24, 2015 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices()
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