Thank U
I need to get logs in a UNC path Like
Machinename Uninstalled VLC at 27-10-2009 10.00 PM
Main Topics
Browse All TopicsHi,
Change script to work as a startup script rather than a txt file.
Instead of Psexec and a txt file of systems i want it to work on invividual systems so can be used as a login script. And a log file that records the machines its found and date and machine name that its uninstalled.
Regards
Sharath
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Let me study this a little more when at my main machine, i am on my laptop now and it doesn't have my normal tools. But I will help. I use scripts to uninstall software all the time in my network. So I believe I can help you out. There are ways to use script to runas an administrator or someone with authorities to uninstall.
Sorry Sharath, got pulled away on something - try this modification:
If it doesn't work (or maybe even if it does), I'd suggest another route here - perhaps using vbscript if there's no other automated solution.
The processing of this thing is potentially exceptionally lengthy - this code scans an entire drive before proceeding to uninstall? I'd imagine folks would complain sooner or later...
I would like to try a different perspective if I may.
You mentioned that a machine, in the log, shows NO uninstall. But you say that the machine has the file at:
C:\Program Files\VideoLAN\VLC
Is the actual path to the uninstall on this machine
C:\Program Files\VideoLAN\VLC\uninsta
If so, please search this paticular machines registry for this string.
Basically, I am trying to find where under hklm is the Uninstallstring found.
If you could find the registry path to the key that holds this path on this machine I may be able to help.
Most likely it will be found somewhere in
hkey_local_machine\SOFTWAR
In there you should find a folder that correlates to the software name.
I need to know this subkey. Inside this subkey, you should find a key named "UninstallString" in the right pane. The value for that key should be the "path to the uninstall.exe" for the software.
Try this for the uninstall. I did NOT mess with the service status or starting or stopping the service. If this is required I can add it easily. Just ran out of time here.
Here is a script to try. It should find the Uninstall wherever it may be on the local machine and uninstall it. Since earlier you posted that the Uninstall didn't have any flags I am not sure if it will uninstall silently without user input or not.
Try it and let me know. I am NOT able to test this, so there may be a syntax error somewhere I may have missed.
I forgot one more thing. A mistake I just found
Change:
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyP
To
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyP
on line 40 and 41 (What I said to change shows 1 line above, in the script the line is split into two) Just make sure that the total statement shows this change.
objFile.WriteLine("ERROR: Uninstall found at : " & UninstallStringToUse & " -- " & CName & " failed to initiate the VLC Uninstall. Error number : " & Err.Number & " Error description: '" & Err.Description & "'"
I forgot to put a ")" at the end of the statement.
Make it
objFile.WriteLine("ERROR: Uninstall found at : " & UninstallStringToUse & " -- " & CName & " failed to initiate the VLC Uninstall. Error number : " & Err.Number & " Error description: '" & Err.Description & "'")
Please make sure you make the other changes I said, or the script WON'T work. It would read the WRONG key.
I did the last 2 changes also. I get this
--------------------------
Windows Script Host
--------------------------
Script: C:\Users\SharathR\Desktop\
Line: 60
Char: 1
Error: Expected 'End'
Code: 800A03F6
Source: Microsoft VBScript compilation error
--------------------------
OK
--------------------------
If you remember from a previous post I had you do the uninstall.exe /?
usually this will show any switches. In all honesty most switches are in the actual SETUP.exe for the program.
you can see if you do a setup.exe /? from a dos prompt for the original install setup.
Most times there is a /u /s switches where /u = uninstall and /s = Silent
if that is what the log reads then the exe was initiated.
You can remove the On error resume next at the beginning and rerun. If there is an error it will prompt. Could be a permissions issue too.
You could also open your Task Manager and watch the Processes (I would sort them by clicking on the heading). Run the script with the Task Manager up. This will also tell you if the uninstall.exe was started. The logon script has no way of knowing if the uninstall was SUCCESSFUL or not since it doesn't monitor windows events for success or failure. You can also check your Event Viewer logs and see if you can find where the failure occurred.
Hmm, that number doesn't match my above script with what i expected. If it is the line
WshShell.Run UninstallStringToUse
Then change on around Line 42
UninstallStringToUse = strValue
To
UninstallStringToUse = Cstr(strValue)
maybe for some odd reason a string value from registry when querying makes it a variant and not string. if you make this change then script will convert whatever it is to String. Then retry.
I get this
--------------------------
Windows Script Host
--------------------------
Script: C:\Users\SharathR\Desktop\
Line: 51
Char: 45
Error: Cannot use parentheses when calling a Sub
Code: 800A0414
Source: Microsoft VBScript compilation error
--------------------------
OK
--------------------------
I was under the impression that the code in your original question (the BAT file) was unacceptable since it took a VERY long time to execute.
That is the only reason i was trying to do it in vbscript using the registry. When the program is installed the registry entry is created. It will have the location of the uninstall file in that key, REGARDLESS of what local drive it was installed on. For this reason, a "search" of all the local drives BEFORE executing the uninstall is not necessary.
If this is not the case, then I will stop trying to update the script.
and yes, the flags will be the same regardless of how you invoke the install.
I get this
--------------------------
Windows Script Host
--------------------------
Script: C:\Users\Sharat\Desktop\Vl
Line: 57
Char: 80
Error: Cannot use parentheses when calling a Sub
Code: 800A0414
Source: Microsoft VBScript compilation error
--------------------------
OK
--------------------------
Try to Change
WshShell.Exec UninstallStringToUse
UninstallStringToUse = "runas /user:administator " & UninstallStringToUse
WshShell.Exec UninstallStringToUse
Replace the one line with the two lines. This is just a try. I had assumed that the permissions were in place. This may NOT work. If not, we can try something else.
Curious, did the "runas" part i posted
UninstallStringToUse = "runas /user:administator " & UninstallStringToUse
WshShell.Exec UninstallStringToUse
Did it work for you? If not, you may want to test a machine directly with login script. If I am not mistaken, the login script being sent from the AD will run as administrator instead of from the local users permission levels. I think it would run as System.
Yes Jeff it did work......
Any help on these..When time permits....
http://www.experts-exchang
http://www.experts-exchang
http://www.experts-exchang
Business Accounts
Answer for Membership
by: sirbountyPosted on 2009-10-26 at 04:31:28ID: 25661175
Here it is, though not sure it will work as a logon script, unless your users are admins...
Select allOpen in new window