Auslogic Disk Defrag

You need help to start using UVK? You have a doubt on a UVK feature? Post here!
Forum rules
We have no special rules for UVK forums. Just try to be polite and clear in your posts.
Please don't post spam in this forum. Spammers will be banned by IP, e-mail and username.
We reserve the right to delete all posts and ban all users we consider not having respected these rules without warning.
wrc559
Posts: 118
Joined: Sun Mar 22, 2015 2:38 am
Location: Australia
Contact:

Auslogic Disk Defrag

Post by wrc559 »

Can some one help my code with Tech Tool Store.

I tried to add Auslogics to the list however, I dont know if i have done the coding correctly.

The program downloads, Installs & Opens automatically... (That's all - The rest is manual from here)
But I would also like it to run a Defrag and Optimise, or Quick defrag, Or Full defrag on automation.
I understand I may need Multiple tool configurations for each setup, but this is my current setup.

Download URL - Direct Download:
http://static.auslogics.com/en/disk-def ... -setup.exe
Download File:
%ToolsDir%\disk-defrag-setup.exe
Command 1:
"%ToolsDir%\disk-defrag-setup.exe" /SP- /VERYSILENT /SUPPRESSMSGBOXES
Extra Commands:
%ProgramFiles%\Auslogics\DiskDefrag\cdefrag.exe -c [-f] [-quiet] [-bk]
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: Auslogic Disk Defrag

Post by Charger440 »

Let me check in to this and I'll see if I can help you...
Jim

It is not "Can it be done?" but rather, "How can we do it?"
wrc559
Posts: 118
Joined: Sun Mar 22, 2015 2:38 am
Location: Australia
Contact:

Re: Auslogic Disk Defrag

Post by wrc559 »

Charger440 wrote:Let me check in to this and I'll see if I can help you...
Thank you, I'll admit. Slow learner - but when I understand how it all operates, The codes won't stop coming.

Hope I can offer support to the forum when I become pro.
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: Auslogic Disk Defrag

Post by Charger440 »

wrc559 wrote: Extra Commands:
%ProgramFiles%\Auslogics\DiskDefrag\cdefrag.exe -c [-f] [-quiet] [-bk]
This should be:
%ProgramFiles%\Auslogics\DiskDefrag\cdefrag.exe -c -f -quiet -bk

I have not gotten it to work correctly from this or from the run dialog but that same command-line group works just fine from an actual Admin Level console window.

Note: The square ([]) bracket is generally used to denote optional command-line parameters, for example:
"-c [-f] [-quiet] [-bk][/quote]" means "-c" is intended and the rest of them are options that could go with "-c."

I am pretty sure there is a command in UVK scripting to run from command-line but I can't seem to find it. I know Fred knows it (obviously) and maybe he can post when he gets up in the morning what it is. Then maybe your parameters will run since they don't seem to do too well running it with params.
Jim

It is not "Can it be done?" but rather, "How can we do it?"
Fred
Site Admin
Posts: 2360
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Auslogic Disk Defrag

Post by Fred »

Hey guys. Just got off the bed.

wrc559, as Jim said, you just need to remove those brackets.

if you want the console to show up and show defragmentation progress, also remove -quiet and -bk:
%ProgramFiles%\Auslogics\DiskDefrag\cdefrag.exe -c -f

To force a program to run from the command line prepend %ComSpec% /c and enclose parameters that may have white spaces in double quotes:
%ComSpec% /c "%ProgramFiles%\Auslogics\DiskDefrag\cdefrag.exe" -c -f
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
Fred
Site Admin
Posts: 2360
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Auslogic Disk Defrag

Post by Fred »

If you are wondering why I enclosed %ProgramFiles%\Auslogics\DiskDefrag\cdefrag.exe in double quotes, even if the string does not contain any white space, here's the answer:

%ProgramFiles% expands to C:\Program files, which contains one white space.
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
wrc559
Posts: 118
Joined: Sun Mar 22, 2015 2:38 am
Location: Australia
Contact:

Re: Auslogic Disk Defrag

Post by wrc559 »

Thanks for this,
When running %ComSpec% /c "%ProgramFiles%\Auslogics\DiskDefrag\cdefrag.exe" -c -f
Is the CMD not meant to appear?
I just have Tech Tool Store running the command without any CMD interface.
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: Auslogic Disk Defrag

Post by Charger440 »

I'll check but the only way I got it to work was from a console window. The run dialog with command line args did nothing as far as I could tell.
Jim

It is not "Can it be done?" but rather, "How can we do it?"
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: Auslogic Disk Defrag

Post by Charger440 »

Fred

Do you have an answer for this? His AusLogic when used with standard command-line parms does NOT recognize them. When used from the Run dialog (Win-R) does not recognize the args. When ran from a Console window works just fine in the console window. When used with %Comspec% it opens the console window then closes and opens the normal window that ignores the command-line args.

Any idea on this? I will look more in the mean time.
Jim

It is not "Can it be done?" but rather, "How can we do it?"
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: Auslogic Disk Defrag

Post by Charger440 »

Fred

I think I found a bug in TTS:
%ComSpec% /k "%ProgramFiles%\Auslogics\DiskDefrag\cdefrag.exe" -c -f (I used "k" instead of "c" so it would stay open.)

Opens a console window that gives the Error:
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

C:\Windows\system32>
Jim

It is not "Can it be done?" but rather, "How can we do it?"
wrc559
Posts: 118
Joined: Sun Mar 22, 2015 2:38 am
Location: Australia
Contact:

Re: Auslogic Disk Defrag

Post by wrc559 »

Hope this can help lift the light on the problems.

So, I may have figured it out... slightly.
I have attached step 1-finish below in the images.

If there is a way to NOT open the UI & just the Command Prompt Auslogic's program interface I'm all for that!

But, after altering the code again, hopefully may be able to assist others now, if you wanted to add it to your program list.
Attachments
Step 5
Step 5
img 5.png (527.27 KiB) Viewed 6908 times
Step 4
Step 4
img 4.png (520.23 KiB) Viewed 6908 times
Step 3
Step 3
img 3.png (402.53 KiB) Viewed 6908 times
Step 2
Step 2
img 2.png (547.85 KiB) Viewed 6908 times
Step 1
Step 1
Image 1.png (769 KiB) Viewed 6908 times
wrc559
Posts: 118
Joined: Sun Mar 22, 2015 2:38 am
Location: Australia
Contact:

Re: Auslogic Disk Defrag

Post by wrc559 »

Image 6 added
Attachments
Image 6
Image 6
img 6.png (367.99 KiB) Viewed 6907 times
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: Auslogic Disk Defrag

Post by Charger440 »

What does your %ComSpec% code do? On mine, the way you had it, it opened the command console and immediately closed it then opened the GUI for the app. By changing the "/c" to "/k" I could see that it was throwing an error and not completing...
Jim

It is not "Can it be done?" but rather, "How can we do it?"
wrc559
Posts: 118
Joined: Sun Mar 22, 2015 2:38 am
Location: Australia
Contact:

Re: Auslogic Disk Defrag

Post by wrc559 »

I actually don't think the /c does anything.

Without the %ComSpec% /c or /k the command prompt opens, if i remove the %ComSpec% code from the parameters, just the UI opens by its self.
wrc559
Posts: 118
Joined: Sun Mar 22, 2015 2:38 am
Location: Australia
Contact:

Re: Auslogic Disk Defrag

Post by wrc559 »

Okay, So i completely removed the /c / /k from the code and it just opens a command prompt with C:\windows\system32 on it.
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: Auslogic Disk Defrag

Post by Charger440 »

I personally think Fred needs to look into it. I think it's a bug. Let's wait and see what he had to say when gets ready in the morning. It should work OK with that comspec code I posted but it's only getting "c:\program" and not the rest of the command.
Jim

It is not "Can it be done?" but rather, "How can we do it?"
wrc559
Posts: 118
Joined: Sun Mar 22, 2015 2:38 am
Location: Australia
Contact:

Re: Auslogic Disk Defrag

Post by wrc559 »

well look at the 6th image I posted. It brought up the command prompt and started the job.
I think it is working fine?!
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: Auslogic Disk Defrag

Post by Charger440 »

What code did you use in command 2? Image 6 does look correct to me but I never got it to pass "program files" correctly.
Jim

It is not "Can it be done?" but rather, "How can we do it?"
Fred
Site Admin
Posts: 2360
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Auslogic Disk Defrag

Post by Fred »

Hey guys. I tested this and it worked fine. The console window needs to appear because cdefrag.exe is a console application. For some reason, the main application, DiskDefrag.exe is also launched, probably by the install command, which is the window you see at the right, in the screenshot below.
screenshot.jpg
screenshot.jpg (214.62 KiB) Viewed 6900 times
I used the following command:
%ProgramFiles(x86)%\Auslogics\DiskDefrag\cdefrag.exe -c -f

The console window you see in the bottom left of the pic belongs to cdefrag.exe. The other one at the right belongs to DiskDefrag.exe which is not launched by TTS. So, no bugs.

As for the /c and /k cmd parameters:

First of all just let me tell you that %ComSpec% is just the same as C:\Windows\System32\cmd.exe. It's just easier to type.

/c Carries out the command and then stops (exits). This is great for automation, but you may not have time to see the results of the command displayed in the console after the command.

/k Carries out the command and continues waiting for input. This may be useful to check out the results displayed in the console before it disappears, but it breaks the automation.
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
Charger440
Posts: 1529
Joined: Sun May 25, 2014 7:44 am
Location: Missouri

Re: Auslogic Disk Defrag

Post by Charger440 »

Fred

Did you use WRCs code? I got it to do the console without the main window in my tests. I checked the box for "for don't run if files in 2,3 or 4 exist."

I used "/k" for the purpose of seeing what the console window was doing. However, I never got it to pass "C:\program files", it would only pass "C:\program" and I did have quotes around the path like you did.

I did cdefrag.exe -c -f -bk -quiet directly in a console window and it did not open the GUI in any combination of those. If you don't beat me to it i will get this working right tomorrow if i can get around the TTS "C:\Program" issue.
Jim

It is not "Can it be done?" but rather, "How can we do it?"
Post Reply