GoogleDude Posted September 6, 2006 Share Posted September 6, 2006 (edited) hi everyone i am new so please bare with me if I ask a dumb question. I have set some $vars already in my script but need help converting them into the correct format! I want to convert the below 7z a -tzip -r c:\archive.zip "C:\Documents and Settings\Google\Application Data\Folder\*" into something like below but its not working. when C:\Documents and Settings\Google\Application Data\Folder is already equal to $var $var = "C:\Documents and Settings\Google\Application Data\Folder" RunWait('7z a -tzip -r c:\archive.zip $var') I read into autoit.chm but did not find an answer. please help.. thanks for any help anyone can provide. GoogleDude Edited September 6, 2006 by GoogleDude Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted September 6, 2006 Share Posted September 6, 2006 (edited) your trying to get the location out of the string? Edited September 6, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
GoogleDude Posted September 6, 2006 Author Share Posted September 6, 2006 (edited) No I already did a $FolderPath = RegRead(HK_Local_Machine\Software\blah\blah", "ProfileLocation") in order to set the var? I just need to correct format of the RunWait function with the 7z.exe command in it. I want to replace the "C:\Documents and Settings\Google\Application Data\Folder" with $FolderPath var! I am using SciTech that I downloaded from AutoIt Site but everytime I try to check the format it doesnt come out right and in turn does not run. keeps telling me I have a bad formatted tring in the RunWait line. hope this helps make sense of it. GoogleDude Edited September 6, 2006 by GoogleDude Link to comment Share on other sites More sharing options...
Xenobiologist Posted September 6, 2006 Share Posted September 6, 2006 HI, maybe: MsgBox(0,"Test the path", '7z a -tzip -r c:\archive.zip ' & $var) ;RunWait('7z a -tzip -r c:\archive.zip ' & $var) RunWait(@ComSpec & ' /c 7z a -tzip -r c:\archive.zip ' & $var, '', @SW_SHOW) So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
GoogleDude Posted September 6, 2006 Author Share Posted September 6, 2006 Great that put me one step closer however it is still not working 100% like I was thinking it would. Problem is now that when it runs the RunWait function is it not putting the double quotes around the resulting path of the $var there for breaking the 7z.exe command with its args. Works 7z a -tzip -r c:\archive.zip "C:\Documents and Settings\Google\Application Data\Folder" Does not work. Just sits at spanning....... Im thinking it is becuase it does not have the double quotes around the folder path to zip up since there are spaces. 7z a -tzip -r c:\archive.zip C:\Documents and Settings\Google\Application Data\Folder The test results in MsgBox show it with out quotes around the path. thank you for your help everyone/anyone. GoogleDude Link to comment Share on other sites More sharing options...
GoogleDude Posted September 6, 2006 Author Share Posted September 6, 2006 (edited) This is my whole script im using its really small but yet simple. If Not IsDeclared("Answer") Then Dim $Answer $Answer = MsgBox(262180,"Backup Config Folder?","Do you want to Backup your Profile Data?") Select Case $Answer = 6 ;Yes $ProfilePath = RegRead ( "HKEY_LOCAL_MACHINE\SOFTWARE\Key\SubKey", "Profile" ) DirCreate(@TempDir & "\_temp") FileInstall("7z.exe", @TempDir & "\_temp" & "\7z.exe") MsgBox(0,"Test the path", "7z.exe a -tzip -r c:\archive.zip " & $ProfilePath) RunWait(@ComSpec & " /c %temp%\_temp\7z.exe a -tzip -r c:\archive.zip " & $ProfilePath) Exit EndSelect Exit Edited September 6, 2006 by GoogleDude Link to comment Share on other sites More sharing options...
GoogleDude Posted September 6, 2006 Author Share Posted September 6, 2006 My Objective here is really just to read a registry value for a local path and zip that whole folder up and place the zip file on the desktop or where ever. If I am going about this the wrong way I am open to any suggestions that any of the AutoIt Pro's might have. GoogleDude Link to comment Share on other sites More sharing options...
ChrisL Posted September 6, 2006 Share Posted September 6, 2006 My Objective here is really just to read a registry value for a local path and zip that whole folder up and place the zip file on the desktop or where ever. If I am going about this the wrong way I am open to any suggestions that any of the AutoIt Pro's might have. GoogleDude What about this? If Not IsDeclared("Answer") Then Dim $Answer $Answer = MsgBox(262180,"Backup Config Folder?","Do you want to Backup your Profile Data?") Select Case $Answer = 6;Yes $ProfilePath = RegRead ( "HKEY_LOCAL_MACHINE\SOFTWARE\Key\SubKey", "Profile" ) DirCreate(@TempDir & "\_temp") FileInstall("7z.exe", @TempDir & "\_temp" & "\7z.exe") MsgBox(0,"Test the path", "7z.exe a -tzip -r c:\archive.zip " & $ProfilePath) RunWait(@ComSpec & " /c %temp%\_temp\7z.exe a -tzip -r c:\archive.zip " & Chr(34) & $ProfilePath & Chr(34)) Exit EndSelect Exit [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
GoogleDude Posted September 7, 2006 Author Share Posted September 7, 2006 @ ChrisL You da man. Lucky you im married and have 3 kids or I would kiss you. Many thanks, GoogleDude 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