kenbo Posted October 20, 2005 Share Posted October 20, 2005 Hi Can anybody have a look at this and tell me what I;m doing wrong? RunWait("%windir%\system32\dfrg.msc") Error is = "Unable to execute the external command" I have also used "Run" to no avail. Help Link to comment Share on other sites More sharing options...
BigDod Posted October 20, 2005 Share Posted October 20, 2005 Hi Can anybody have a look at this and tell me what I;m doing wrong?RunWait("%windir%\system32\dfrg.msc")Error is = "Unable to execute the external command"I have also used "Run" to no avail.Help dfrg.msc is not an executable. Try using defrag.exe. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
kenbo Posted October 20, 2005 Author Share Posted October 20, 2005 dfrg.msc is not an executable. Try using defrag.exe. No can do. Still getting the same error. Link to comment Share on other sites More sharing options...
BigDod Posted October 20, 2005 Share Posted October 20, 2005 No can do. Still getting the same error.See this Topic in Scripts and Scraps, it will do what you want or give you some ideas. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
LxP Posted October 20, 2005 Share Posted October 20, 2005 AutoIt won't expand environment variables unless you explicitly tell it to:Opt('ExpandEnvStrings', 1)I would suggest grabbing SlimShady's _ShellExecute() UDF which would allow you to do this:_ShellExecute(EnvGet('SystemRoot') & '\System32\dfrg.msc')Or you could do it this way:Opt('ExpandEnvStrings', 1) RunWait('%SystemRoot%\System32\mmc.exe "%SystemRoot%\System32\dfrg.msc"') Link to comment Share on other sites More sharing options...
Valuater Posted October 20, 2005 Share Posted October 20, 2005 this will do the trick Run("mmc Dfrg.msc", @SystemDir) 8) Link to comment Share on other sites More sharing options...
souldjer777 Posted May 27, 2011 Share Posted May 27, 2011 This is how you defragment a hard drive using domain credentials on XP... Btw... I LOVE AUTOIT ! ! ! Normal users don't need administrator rights to defrag - and they wont bug you. Not recommended to have credentials in there... but hey, it works and what do you do... All the user has to do is click on the compiled exe and defrag! Works in my case! #AutoIt3Wrapper_Icon=defrag.ico #AutoIt3Wrapper_Run_Obfuscator=Y #Obfuscator_Parameters=/CV /CF /CS /CN RunAsWait("mydomainusername", "mydomain.org", "mydomainpassword", 0, "mmc.exe dfrg.msc", @SystemDir) "Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"Song Title: I guess you could sayArtist: Middle Class Rut 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