rdwray Posted December 20, 2010 Share Posted December 20, 2010 (edited) Yes, I have looked in this forum. Here is a command that I cannot get to work. I have tried with shortcuts, AutoIt's FileCreateShortcut and batch files. I put a full day into this and everything has failed. Is there a way? BTW: OS is Win 7 HP 64bit. Thanks...%windir%\system32\dfrgui.exe Edited December 20, 2010 by rdwray “No other God have I but Thee; born in a manger, died on a tree.” Martin Luther Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 20, 2010 Moderators Share Posted December 20, 2010 rdwray,Have you used Opt("ExpandEnvStrings", 1) so that %windir% is properly expanded in the string? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
shanet Posted December 20, 2010 Share Posted December 20, 2010 (edited) Ahh. The master control panel. I actually made a batch file to do this, along with other windows secrets. Just one minute, lets see if I can find it. Here we go, in batch the Master Control Panel is made using this command: Monster Control Panel.{ED7BA470-8E54-465E-825C-99712043E01C} Therefore, in AutoIt, it is made as follows: DirCreate((path)\Monster Control Panel.{ED7BA470-8E54-465E-825C-99712043E01C}") As for the shortcut, you are on the right track. Refer to the above comment. shanet Edited December 20, 2010 by shanet [font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS: %programfiles%/AutoIt3/autoit3.chm Link to comment Share on other sites More sharing options...
rdwray Posted December 20, 2010 Author Share Posted December 20, 2010 rdwray,Have you used Opt("ExpandEnvStrings", 1) so that %windir% is properly expanded in the string? M23M23, If it exists, I have tried it...Thanks.... “No other God have I but Thee; born in a manger, died on a tree.” Martin Luther Link to comment Share on other sites More sharing options...
rdwray Posted December 20, 2010 Author Share Posted December 20, 2010 Ahh. The master control panel. I actually made a batch file to do this, along with other windows secrets. Just one minute, lets see if I can find it. Here we go, in batch the Master Control Panel is made using this command: Monster Control Panel.{ED7BA470-8E54-465E-825C-99712043E01C} Therefore, in AutoIt, it is made as follows: DirCreate((path)\Monster Control Panel.{ED7BA470-8E54-465E-825C-99712043E01C}") As for the shortcut, you are on the right track. Refer to the above comment. shanet Thanks shanet, but I have that command. My goal is to open defragment directly. “No other God have I but Thee; born in a manger, died on a tree.” Martin Luther Link to comment Share on other sites More sharing options...
Chimaera Posted December 20, 2010 Share Posted December 20, 2010 In vista and windows 7 much that could be done with defragmenter was taken out like the -w switch for eg which leaves large fragments left untouched Its pretty much a waste of time now Defraggler is a better solution and has command line options to get the job done, and its free It can be installed silently with the Defraggler - Slim Build, look on the builds page for the download http://www.piriform.com/defraggler If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
rdwray Posted December 20, 2010 Author Share Posted December 20, 2010 Since the previous does not work, why does this fail?$file = FileGetShortcut("F:\Backup\Common\ShortCuts\Disk Defragmenter.lnk") MsgBox(0, "", $file[0]) Run($file[0]) “No other God have I but Thee; born in a manger, died on a tree.” Martin Luther Link to comment Share on other sites More sharing options...
sleepydvdr Posted December 20, 2010 Share Posted December 20, 2010 (edited) I guess I don't understand what the problem is. Are you having trouble running Defrag or creating a shortcut or what? run (@SystemDir & "\dfrgui.exe") ;runs defragmenter FileCreateShortcut(@SystemDir & "\dfrgui.exe", @DesktopDir &"\Disk Defragmenter.lnk", @SystemDir) ;creates a working shortcut Edit: This worked with Win 7 32 bit. I don't have 64 bit at work to play with. Edited December 20, 2010 by sleepydvdr #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
rdwray Posted December 20, 2010 Author Share Posted December 20, 2010 I guess I don't understand what the problem is. Are you having trouble running Defrag or creating a shortcut or what? run (@SystemDir & "\dfrgui.exe") ;runs defragmenter FileCreateShortcut(@SystemDir & "\dfrgui.exe", @DesktopDir &"\Disk Defragmenter.lnk", @SystemDir) ;creates a working shortcut Edit: This worked with Win 7 32 bit. I don't have 64 bit at work to play with. It will create the shortcut and the shortcut works, but with double clicking the shortcut, it will not run defrag. If there was a way to double click the shortcut or program name??????? “No other God have I but Thee; born in a manger, died on a tree.” Martin Luther Link to comment Share on other sites More sharing options...
sleepydvdr Posted December 20, 2010 Share Posted December 20, 2010 I'm at home now and just tried it out on my Win 7 64 bit system and defrag works with the shortcut it created. Perhaps your UAC is set to high security. Also, have you considered bypassing the GUI with unattended defrag parameters? http://www.winhelponline.com/blog/new-defrag-cmd-line-parameters-windows-7/ #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
rdwray Posted December 20, 2010 Author Share Posted December 20, 2010 I'm at home now and just tried it out on my Win 7 64 bit system and defrag works with the shortcut it created. Perhaps your UAC is set to high security. Also, have you considered bypassing the GUI with unattended defrag parameters?http://www.winhelponline.com/blog/new-defrag-cmd-line-parameters-windows-7/Yes, the shortcut does work. What I am after is some way to run defrag with a button. “No other God have I but Thee; born in a manger, died on a tree.” Martin Luther Link to comment Share on other sites More sharing options...
sleepydvdr Posted December 20, 2010 Share Posted December 20, 2010 Still not 100% sure what you are wanting. How about these ideas? $Shortcutpath = FileGetShortcut(@DesktopDir & "\Disk Defragmenter.lnk") run ($Shortcutpath[0]) WinWaitActive("Disk Defragmenter") send ("d") Or #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 214, 78) $Button1 = GUICtrlCreateButton("Defrag", 72, 24, 75, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 run (@SystemDir & "\defrag.exe /A c: ") EndSwitch WEnd #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
rdwray Posted December 21, 2010 Author Share Posted December 21, 2010 Yep sleepydvdr, I am still waiting. I tried both and they didn't work. Defrag.exe is DOS based and I am sure that would take a command window which can be accessed via a .bat file. I guess MS has got the upper hand on this one "also".... “No other God have I but Thee; born in a manger, died on a tree.” Martin Luther Link to comment Share on other sites More sharing options...
sleepydvdr Posted December 21, 2010 Share Posted December 21, 2010 I just tried compiling both of the last 2 scripts I posted as 32 bit and 64 bit. When I compiled as 32 bit, neither worked. But they did work when I compiled as 64 bit. If that works and you still want to compile your script as 32 bit, you could use @OSArch to determine if the OS is 64 bit and start a 64 bit exe. #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
BrewManNH Posted December 21, 2010 Share Posted December 21, 2010 Sleepydvdr's scripts will run defrag, the only thing is though, the -a or /A command line switch only analyzes the disk but doesn't actually defrag the drive. If you take out the /A it will defrag the drive by clicking the button. 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...
rdwray Posted January 21, 2011 Author Share Posted January 21, 2011 I have been doing some research on this problem and found out that AutoHotKey's "Run" will run Dfrgui.exe so there has to be a bug in AutoIt. Does anyone have a resolve on how to handle this issue or do I move to AutoHotKey???? thanks.... “No other God have I but Thee; born in a manger, died on a tree.” Martin Luther Link to comment Share on other sites More sharing options...
trancexx Posted January 21, 2011 Share Posted January 21, 2011 I have been doing some research on this problem and found out that AutoHotKey's "Run" will run Dfrgui.exe so there has to be a bug in AutoIt. Does anyone have a resolve on how to handle this issue or do I move to AutoHotKey???? thanks.... Yeah, that's it, a bug. Can't be anything else because of your research. I've done no research and just tried to think with premise that you aren't the brightest bulb. DllCall("kernel32.dll", "boolean", "Wow64EnableWow64FsRedirection", "boolean", 0) Run("dfrgui.exe") DllCall("kernel32.dll", "boolean", "Wow64EnableWow64FsRedirection", "boolean", 1) ;... Good luck with AutoHotKey. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
rdwray Posted January 21, 2011 Author Share Posted January 21, 2011 Yeah, that's it, a bug. Can't be anything else because of your research. I've done no research and just tried to think with premise that you aren't the brightest bulb. DllCall("kernel32.dll", "boolean", "Wow64EnableWow64FsRedirection", "boolean", 0) Run("dfrgui.exe") DllCall("kernel32.dll", "boolean", "Wow64EnableWow64FsRedirection", "boolean", 1) ;... Good luck with AutoHotKey. Well trancexx, since you evidently more intelligent than I am, how about explaining why one works and the other one doesn't? You have got me in suspense - my bulb is almost out. “No other God have I but Thee; born in a manger, died on a tree.” Martin Luther Link to comment Share on other sites More sharing options...
trancexx Posted January 21, 2011 Share Posted January 21, 2011 Well trancexx, since you evidently more intelligent than I am, how about explaining why one works and the other one doesn't? You have got me in suspense - my bulb is almost out.Very nice. ...Usually people start crying when I say something like that. Do you mean why it works with disabled redirection? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
rdwray Posted January 21, 2011 Author Share Posted January 21, 2011 Very nice. ...Usually people start crying when I say something like that. Do you mean why it works with disabled redirection?No, why does the Run function in AutoIt fail when AutoHotKey works? I came from AHK to AutoIt because of better formatting and it was my understanding that both compilers were the same at one time. “No other God have I but Thee; born in a manger, died on a tree.” Martin Luther 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