cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jasonwch
Engaged Sweeper
Our corporate have many different version of Chrome, and most of them installed in user profile instead of program files. May I know how can I prepare a package to uninstall all different version of Chrome?

Thanks
1 ACCEPTED SOLUTION
Bert_D
Lansweeper Employee
Lansweeper Employee
Using a correct command => you get the return code of the command or the function you are using.
example: using the /fi command returns 0 or 1 (false or true)

Using an incorrect command => results into the windows error code 1 (incorrect function)
example: a typo like mkdi instead of mkdir


These are 2 different cases with the same result (return code 1) and therefore may cause some confusion here and there.


We at Lansweeper always recommend you try out your command on a command prompt first.
Once it is fully functional and thoroughly tested you can paste it in a 'Command' Step.

View solution in original post

6 REPLIES 6
Bert_D
Lansweeper Employee
Lansweeper Employee
@joshwinters: Good addition. Thx.

@PeterG: That's exactly the way to go in these situations. Nice problem solving there.
PeterJG
Champion Sweeper II
you can modify the command to

for /d /r "%systemdrive%\users" %d in (*.rdp) do @if exist "%d" del /q /f "%d"

that way it deletes only if exists and returns the proper error code.
joshwinters
Engaged Sweeper II
Just to add to this discussion, it may not always be the case that you used an incorrect command or incorrect syntax.

For example, let's say you have a batch file that is tasked with cleaning up any file matching *.rdp in the C:\Users directory.

The command I would run is : del /s /q %systemdrive%\users\*.rdp

If the particular file does not exist, the command prompt will return a message of "Could not find <file>"

Even though the syntax of this particular command is correct, the result is that the file didn't exist. This will result in the "Result: Deployment ended: Incorrect function. Stop(Failure)." error in LANsweeper deployment logs.

The reason I am submitting this is because I had the exact scenario described above. I derived from the "incorrect function" message that the computer didn't contain the file and nothing was deleted. Hope this helps someone!
Bert_D
Lansweeper Employee
Lansweeper Employee
Using a correct command => you get the return code of the command or the function you are using.
example: using the /fi command returns 0 or 1 (false or true)

Using an incorrect command => results into the windows error code 1 (incorrect function)
example: a typo like mkdi instead of mkdir


These are 2 different cases with the same result (return code 1) and therefore may cause some confusion here and there.


We at Lansweeper always recommend you try out your command on a command prompt first.
Once it is fully functional and thoroughly tested you can paste it in a 'Command' Step.
mfry1379
Engaged Sweeper II
I have a suspicion the "incorrect function" is a red herring. I get this with another command I am running but it seems to deliver the correct feedback by way of errorlevels.

I would focus less on the LANSweeper part and focus on how to do the uninstall from a script, then add the script to LANSweeper.

http://www.itninja.com/question/how-to-uninstall-any-version-google-chrome-there-is-no-uninstall-str...
jasonwch
Engaged Sweeper
Anyone?

Error: Result: Deployment ended: Incorrect function. Stop(Failure). Credential: (XXXXXXXX). ShareCredential: (XXXXXXXXXXXXX).