Sign in to follow this  
Followers 0
kenbo

Defrag

7 posts in this topic

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

B)

Share this post


Link to post
Share on other sites



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

B)

dfrg.msc is not an executable. Try using defrag.exe.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

dfrg.msc is not an executable. Try using defrag.exe.

No can do. Still getting the same error.

Share this post


Link to post
Share on other sites

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.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

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"')

Share this post


Link to post
Share on other sites

this will do the trick

Run("mmc Dfrg.msc", @SystemDir)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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!

:huh2:

#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 say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0