Jump to content

Boss has asked if this is possible


Chimaera
 Share

Recommended Posts

Hi all

My boss at work has asked is it possible to have a tool that performs a health check on a pc and removes any temp files and unwanted startup entries, sort of a small service if you will.

He is planning to do some leaflet drops and wants to offer a free checkup which the tool will provide, so basically run from a pendrive quick health check and makes a printout we can give with advise notes, the sort that sell more services like could have extra ram fitted etc, not enough antivirus protection etc

Im sure you get the picture

So what i need to know is is this possible and to what degree can it be done?, we prob dont need a too over the top one as a lot of the customers are elderly etc

Is it feasible time wise cos i aint the best at coding

just some suggestions which way to go, or maybe tools to adapt? or maybe this has already been done?

Many thanks

Jez

Link to comment
Share on other sites

The best tool to do this sort of thing is ccleaner. (http://www.ccleaner.com) It will do just what you need, it's free, and you can run it by command line which makes it simple to use. Feel free to PM me if you need assistance with it or if you have other non-AutoIt related questions. Hope this helps.

Link to comment
Share on other sites

@MPH im familar with CCleaner we have it on our tech pendrives, i suppose i could include it in the script so it does a silent install and run it to remove the rubbish then uninstall at the end.

Or even jusst do the check and advise not remove

@Richard Robertson ok not so easy to describe i want a report that leaves room for upselling ie not enough memory for eg (Vista and 1gb = Need more memory)that kind of thing

I dont want to scare the sh1t out of them but have a report which they get for free with minumum fuss from us, cos we are busy with the normal jobs and this cant hog too much of our time

So from the report we can advise you have too little hard drive space available left on OS drive for eg or when was defragmenter run or when was last antivirus scan done

those kind of health things

Jez

Edited by Chimaera
Link to comment
Share on other sites

CCleaner will do the job silently if you like. To perform a silent cleaning you can use the auto switch.

"ccleaner.exe /auto"

It will clean the machine. I use it all the time with my clients. The folks at Piriform also have a tool called Defragler. It is a superior defrag tool than the built in windows defrag. Defraggler also has command line support so you can have your techs do a defrag that can be scheduled after they leave or in the evening after they owner has retired for the evening.

Edited by MPH
Link to comment
Share on other sites

The reason i mentioned silently was this is more about creating a report than doing any actuall work as we dont have the time unless they are paying for it, thinking about it if the report just said you have XXX Mb of temp files and rubbish that would be suffiecient.

I probably explained it badly in first instance

maybe it just needs some simple ish checks and a possible clean of temp stuff if boss wants that, im guessing he will be offering 10% off if they have work done on the basis of the check, or something along those lines

usefull tip about auto thanks

Jez

Edited by Chimaera
Link to comment
Share on other sites

Chimaera, I think you need to just decide what you want it to do, asking for preverbial "stuff and shit" is getting you no-where.

For example if you want to check disc space, then search for Check disk space, peruse it and move on to the next thing you want it to do.

etc... and that sort of thing :graduated:

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

The cynics amongst us might think you're trying to rip off the vulnerable old folks, cold-calling to improve something they've not had a problem with!

Now that is something i wouldnt do, the idea of cleaner etc being added to the job was me, my boss yes he would definatly try that and he wants something that takes less than 1 min to achieve and no cost to him , but i think that stuff is very wrong, i dont want to sell anyone anything unless they need it, i regualry tell people there is no need to have something done if its not necessary, they still come back and buy stuff because i have been honest.

Yes we are trying to increase our business but not that way

Chimaera, I think you need to just decide what you want it to do, asking for preverbial "stuff and shit" is getting you no-where.

For example if you want to check disc space, then search for Check disk space, peruse it and move on to the next thing you want it to do.

etc... and that sort of thing :graduated:

Ill try and have a think at work today about what best things to add are.

"Boss has asked if this is possible" - Tell him 'Anything is possible' .

The only question is "How much ?" .

Hmm that would be nice but im on minumum wage and there will be no extra pay for all the hrs i will have to put into this, im a self taught tech with no certificates in a small pc repair shop and if i tried that route he would just say heres your p45 and get another doley to replace.

Link to comment
Share on other sites

I see what you are trying to do. You want to work smarter. Nothing wrong with that. The problem here is what you are asking for:

Takes more than a minute to run depending on the PC in question.

Cleaning or repairing the machine also takes a unknown amount of time.

In some cases cleaning the PC will break something. One has to be careful.

I understand your in the UK but at the same time working for minimum wage in a PC shop - your boss is ripping you off. If you are self taught you could look into doing OnForce when they start operations in the UK. I have friends who do it in the US and made good money in the past. I'm not sure in this economic environment how your pay will be, but the best way to look at it is the business model will allow you to network and build up a client base. You then remove the vendor from the equation and get paid directly. There is much more money to made this way.

Edited by MPH
Link to comment
Share on other sites

You didnt get me. "How much ? " means how much work and resources are needed to make it possible.

Not how much he will pay you to do it.

being as he is tight somewhere between £0.00 and £0.01 :graduated: ... really

I see what you are trying to do. You want to work smarter. Nothing wrong with that. The problem here is what you are asking for:

Takes more than a minute to run depending on the PC in question.

Cleaning or repairing the machine also takes a unknown amount of time.

In some cases cleaning the PC will break something. One has to be careful.

Dont worry i wrote the disclaimer for our place they didnt have one till i worked there, ive included about stressing compenents etc and what can happen

I understand your in the UK but at the same time working for minimum wage in a PC shop - your boss is ripping you off. If you are self taught you could look into doing OnForce when they start operations in the UK. I have friends who do it in the US and made good money in the past. I'm not sure in this economic environment how your pay will be, but the best way to look at it is the business model will allow you to network and build up a client base. You then remove the vendor from the equation and get paid directly. There is much more money to made this way.

Yes of course he is ripping me off, he knows his staff will only stay so long because of the wages, but its a nice place to work on the whole and there is no stress.

I through my own efforts have made him coding solutions in CMD to automate much of his tech area and backup solutions which have helped him no end, but also helped me and the other 2 employees to work easier, whilst i didnt recieve a penny for my efforts, i enjoyed the challenge... but most of the bigger companies i have worked for over the years dont like employees that can think too radical, so you learn to suppress what you can do i guess.

I was unemployed for nearly a year and i work part time now 20 hrs a week but at least i can pay my way, the town i live is a deadbeat place with no money or prospects, but my little lad is here with my ex, and im nearly 50 so i stay, sometimes we are governed by outside factors.

If im honest i doubt i could handle working for a big company as im a little to freelance at times ;o) but thanks for the link and ill see what happens.

Back on topic

Lets have a change of tack

ive found a program at work which exports to a txt file like below

Computer Type                                        ACPI x86-based PC
      Operating System                                     Microsoft Windows 7 Home Premium
      OS Service Pack                                      -
      Internet Explorer                                    8.0.7600.16385
      DirectX                                              DirectX 11.0

Is it possible to search for "DirectX" and have it return "DirectX 11.0" this is just an example in the txt file there is about 4 tab spaces between the 2 bits of text whether that matters? and then export the findings to a new textfile or word document that i can print and give back with the pc?

Then if for eg it returns IE as being 6.0 etc i can set autoit to flag that it needs upgrading just as an example.

This seems a more sensible route to take

Jez

Link to comment
Share on other sites

Back on topic

Lets have a change of tack

ive found a program at work which exports to a txt file like below

Computer Type                                        ACPI x86-based PC
      Operating System                                  Microsoft Windows 7 Home Premium
      OS Service Pack                                      -
      Internet Explorer                                    8.0.7600.16385
      DirectX                                              DirectX 11.0

Is it possible to search for "DirectX" and have it return "DirectX 11.0" this is just an example in the txt file there is about 4 tab spaces between the 2 bits of text whether that matters? and then export the findings to a new textfile or word document that i can print and give back with the pc?

Then if for eg it returns IE as being 6.0 etc i can set autoit to flag that it needs upgrading just as an example.

This seems a more sensible route to take

Jez

Interesting thread. Good to see you worked from "something" to a more specific target. What you are asking here is absolutely possible. In fact, it should be fairly easy. You can use StringInStr and/or StringRegExp to work through the lines and search for the info you need. Then use StringMid to get part of your string. This is very basic and could be a nice exercise for you to try some autoit3 code.

There are also some great UDFs around for retrieving a lot of system information. Learn to use those, think of as much useful upgrade tips as you can, combine it with your company's logo and you should have more power. I would suggest to invest a lot of effort in making it look good (use nice background pictures, colored buttons, company logo etc.) and make give at least some things for free (like easy troubleshooting tips, automated installers for things that many people forget like adobe acrobat reader, useful weblinks etc).

A note of caution however: I know from experience that once you get down and dirty with this kind of side projects, it's gonna eat a veritable shitload of your time and become a dangerous addiction! :graduated:

Good luck!

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

Thx for the suggestions, i got a small bit of time to code at work

and i knocked this up but it dosent seem to report the right bit

$file = FileOpen(@ScriptDir & "\report.txt", 0)

; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf


;$date2 = StringInStr($file, "Date")
$date2 = StringRegExp($file, "Date")
$date3 = StringMid($date2,1)
    MsgBox(0, "date", $date3)

$date = FileReadLine($file, 10) ;<<< but the report varies in size with different lines so i cant use these
$time = FileReadLine($file, 11) ;<<< but the report varies in size with different lines so i cant use these
$type = FileReadLine($file, 17) ;<<< but the report varies in size with different lines so i cant use these

MsgBox(0, "Line read:", $date & @CRLF & $time & @CRLF & $type)

FileClose($file)

and the report it looks at

Operating System                                  Microsoft Windows 7 Home Premium 6.1.7600 (Win7 RTM)
    Date                                              2010-11-18
    Time                                              13:45
    Computer Type                                     ACPI x86-based PC
    Operating System                                  Microsoft Windows 7 Home Premium
    OS Service Pack                                   -
    Internet Explorer                                 8.0.7600.16385
    DirectX                                           DirectX 11.0

From reading the helpfile i thought this StringMid($date2,1) would give me the section of the file i wanted which is 2010-11-18 but it just reports "0"

The examples using FileReadLine work fine reporting

Date                                              2010-11-18

but the word date isnt always on line 10 for eg as the report varies depending on the machine which makes them a bit unusable. shame i cant use stringregexp and filereadline together

What is it ive missed?

Link to comment
Share on other sites

The StringRegexp returns true and Stringmid then just read one character. I would expect it to be the "O" in "Operating System".

Try this instead:

$file = FileOpen(@ScriptDir & "\report.txt", 0)

; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf


$date2 = StringRegExp($file, "Date\h*(\H*)") ;look for "Date", followed by horizontal whitespaces, then return any non-horizontal whitespace on that line.
$date3 = $date2[0]
    MsgBox(0, "date", $date3)

$date = FileReadLine($file, 10) ;<<< but the report varies in size with different lines so i cant use these
$time = FileReadLine($file, 11) ;<<< but the report varies in size with different lines so i cant use these
$type = FileReadLine($file, 17) ;<<< but the report varies in size with different lines so i cant use these

MsgBox(0, "Line read:", $date & @CRLF & $time & @CRLF & $type)

FileClose($file)
Link to comment
Share on other sites

thx but i get a

L:\Report Maker.au3 (11) : ==> Subscript used with non-Array variable.: 
$date3 = $date2[0] 
$date3 = $date2^ ERROR

Just did a recheck nothing to do with the error

this line

but it just reports "0" It is a zero not an O

Edited by Chimaera
Link to comment
Share on other sites

I didn't include a check to see if an error was returned because at this point I tried to get something that works and possible errors can be handled laters so the crash wasn't completely unexpected.

Once you have something that works, make sure to add a check if $date2 is an array.

The odd thing is that that pattern worked for me using the string from your codebox. Could you do a "ConsoleWrite($file & @CRLF) to confirm it matches the code box you posted?

The return of "0" seems to be like the result of using stringmid on a variable that is empty. (or False, 0, etc)

Edit: You forgot to do a FileRead. $file is the file handle, not it's contents.

Edited by Tvern
Link to comment
Share on other sites

Ok been playing again and this makes no sense

#Include <String.au3>
#include <Array.au3>


$file = FileOpen(@ScriptDir & "\report.txt", 0)
$chars = FileRead($file, 1)

; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

;-----------------------------------------------
;$chars2 = StringInStr($chars, "Date")
;MsgBox(0, "Search result:", $chars2)

;$date2 = StringRegExp($chars, "Date\h*(\H*)")
    ;MsgBox(0, "date", $date2)

;Local $check = _StringBetween($chars, ", ", ", ")
    ;MsgBox(0, "date", $check)

;Local $check = _StringBetween($chars, "Date", "Time")
    ;MsgBox(0, "date", $check)

;$date2 = StringRegExp($chars, "Date")
;$date3 = StringMid($date2,1)
    ;MsgBox(0, "date", $date3)

;$date2 = StringRegExp($chars, "Date\h*(\H*)")
;$date3 = $date2;[0] <<< this throws an error if i take the comment out before the [0]
    ;MsgBox(0, "date", $date3)
;-----------------------------------------------

FileClose($file)

ive tried all of these between the lines and every single one of them returns a 0, what am i missing plz?

all im trying to do is get it to return the 2010-11-18 on its own

Operating System                                  Microsoft Windows 7 Home Premium 6.1.7600 (Win7 RTM)
    Date                                              2010-11-18
    Time                                              13:45
    Computer Type                                     ACPI x86-based PC
    Operating System                                  Microsoft Windows 7 Home Premium
    OS Service Pack                                   -
    Internet Explorer                                 8.0.7600.16385
    DirectX                                           DirectX 11.0

I keep reading the bits for this in the help file but it dosent seem to work like it says

@Zedna thx for the info , unfortunatly the eg deals with arrays which i havent used

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...