FGR Posted May 23, 2011 Share Posted May 23, 2011 Hi! I'm trying to do this under Windows XP: RunWait(@ComSpec & ' /c'& "%PROGRAMFILES%\WinRAR\rar.exe" a file_comp.rar *.au3') ; (I also tried Run()). but it doesn't work, althought the command works fine in the line command. The idea is to pass more parameters like the namefile as %USERNAME% and the Folder to compress, but with the first trying i can't advance. Any idea? Thanks for all. FGR. Link to comment Share on other sites More sharing options...
Juvigy Posted May 23, 2011 Share Posted May 23, 2011 RunWait(@ComSpec & ' /c'& '"%PROGRAMFILES%\WinRAR\rar.exe" a file_comp.rar *.au3') Link to comment Share on other sites More sharing options...
FGR Posted May 23, 2011 Author Share Posted May 23, 2011 RunWait(@ComSpec & ' /c'& '"%PROGRAMFILES%\WinRAR\rar.exe" a file_comp.rar *.au3')Thanks, and sorry with the simple quote (a writing error). It doesn't works either, a command windows appears and dissappears but the Rar file is not created. Link to comment Share on other sites More sharing options...
hannes08 Posted May 23, 2011 Share Posted May 23, 2011 You can use Run( @ComSpec & "/k" ) for testing purposes. This will keep the window open. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
BrewManNH Posted May 23, 2011 Share Posted May 23, 2011 Try changing the /c to a /k and have it leave the window open, there might be something in the console that will help you trouble shoot what's going wrong. Also, add a space after the /c or the /k and before the " that might help as well. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
FGR Posted May 23, 2011 Author Share Posted May 23, 2011 You can use Run( @ComSpec & "/k" ) for testing purposes. This will keep the window open.Thanks for the help and that option.The problem was the double quote. Now it works:RunWait(@ComSpec & ' /k'& '""%ProgramFiles%\WinRAR\rar.exe"" a file_comp.rar *.au3') Thank you again Link to comment Share on other sites More sharing options...
FGR Posted May 23, 2011 Author Share Posted May 23, 2011 Another question:RunWait(@ComSpec & ' /c'& '""%ProgramFiles%\WinRAR\rar.exe"" a %USERNAME%.Rar *.au3',@SW_HIDE) is @SW_HIDE correct to hide the command windows? It doesn't compress in this case.Thanks for the help and that option.The problem was the double quote. Now it works:RunWait(@ComSpec & ' /k'& '""%ProgramFiles%\WinRAR\rar.exe"" a file_comp.rar *.au3') Thank you again Link to comment Share on other sites More sharing options...
MHz Posted May 23, 2011 Share Posted May 23, 2011 @SW_HIDE will not work well in the working directory parameter of Run(). Try this RunWait('"' & @ComSpec & '" /c "%ProgramFiles%\WinRAR\rar.exe" a %USERNAME%.Rar "*.au3"', "", @SW_HIDE) Link to comment Share on other sites More sharing options...
BrewManNH Posted May 23, 2011 Share Posted May 23, 2011 In this case, you're using the @SW_HIDE flag in the WorkingDir parameter which I'm sure is confusing things. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
FGR Posted May 23, 2011 Author Share Posted May 23, 2011 Thank you to all. It's true. The Working Directory as optional is not working well. Now it works.Thanks again.The Post is closed .Thank you again. In this case, you're using the @SW_HIDE flag in the WorkingDir parameter which I'm sure is confusing things. 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