Solved

Disconnect Network Drive/ Unistall Software Batch File

Posted on 2007-04-10
2
726 Views
Last Modified: 2008-02-01
Hi

Trying to write batch file that will disconnect a network drive and uninstall a program. I can uninstall the softwate from "Add/Remove Programs" but how do I do this from a batch file.

For the disconnect network drive i have the script below, but it keeps on asking for a confirmation to disconnect how can i make it so it just does it automaticatlly without a confirmation and of course how do I unninstall the software

This is the script so far:

net use q: /delete /persistent:yes

Thanks
0
Comment
Question by:patelajk
2 Comments
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 18880993
The uninstall software part depends entirely on the software you are trying to uninstall.  If there's no ability to script it, then you're going to have a very difficult time doing this.

As for disconnecting the network drive, that's easy.

Try:

ECHO Y|NET USE Q: /DELETE

(Using persistent here is kinda pointless).
0
 
LVL 4

Accepted Solution

by:
zivko earned 125 total points
ID: 18881767
Hi,

I do it in this way...
Unmap Network drive silently, as given by Leew: ECHO Y|NET USE Q: /DELETE

To uninstall the program, you must first find the exact command line to do it.
It is available in the registry and you may need to modify it in order for the installation to become silent.

Uninstall registry keys are located here:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\APP\UninstallString
APP = The application name or ID to uninstall
UninstallString = Command to uninstall the application

Regards,
Zivko
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now