MajorGeeks Support Forums IOBit Software

Go Back   MajorGeeks Support Forums > Majorgeeks.Com - Support Forums > Programming
Register FAQ Members List Calendar Casino Mark Forums Read

Programming Place to discuss programming including HTML, Java, C++, MySQL and others.


Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-12, 13:52
PrivatePile PrivatePile is offline
Private First Class
 
Join Date: Dec 2011
Location: Northern Jersey
Posts: 65
Thanks: 1
Thanked 6 Times in 3 Posts
Default Batch File Fun

So I'm starting to learn some basic batch file stuff and I'll admit that I'm not very good. Hopefully someone can help me. My ideal solution would be to have a USB drive, that when plugged in will start running applications sequentially. I've already adopted Ninite to install programs for me, and I'd like for the script to start running the programs immediately after each other. So I would like the USB to be plugged in, immediately run Ninite installer, then run Program 1, when that finishes run Program 2, etc. And then I would like a second batch that will uninstall all the said programs. So here are my questions

1. I know how to get the batch to run an individual program, but I was wondering how to make the batch run sequentially, waiting for the prior program to finish before starting.

2. Is there a way to create a batch that will uninstall several programs. If it could be dynamic by uninstalling anything installed within the past 24 hours that would be great, but I would be happy if I determined which programs got uninstalled. And can this be done w/o user interaction?

3. Does anyone know of a good website that gives you a good tutorial of creating your own batch files?

4. Is it still possible to create the autorun.inf to auto-launch programs upon USB plug-in?
__________________
"...next time someone asks you if you’re a god, you say YES!"
Reply With Quote
Sponsored links
  #2  
Old 04-21-12, 07:42
GermanOne's Avatar
GermanOne GermanOne is offline
Corporal
 
Join Date: Feb 2009
Location: Thuringia / Germany
Posts: 297
Thanks: 4
Thanked 58 Times in 57 Posts
Default Re: Batch File Fun

1.
Code:
start "" /wait "yourInstall.exe" [comand line options]
2.
No, there is no universal uninstaller.
  • If you know what folders/files/shortcuts were created, what libraries were registered, what registry keys where created or changed etc. then you could undo that step by step.
  • If these programs came with an uninstaller you can run it. It depends on the developer of the software whether or not he implemented a command line option to run it silently though.

3.
I'm not a native English. Hence I know some German tutorials but I'm afraid that doesn't help.

4.
Depends on what OS you're working. On XP it was possible to reactivate the autorun for removable drives. I'm virtually certain it's completely disabled/removed on Vista and newer versions due to security leaks.

Regards
GermanOne
Reply With Quote
  #3  
Old 04-21-12, 21:41
foogoo's Avatar
foogoo foogoo is offline
Major Geek
 
Join Date: Jul 2004
Location: SW Ohio
Posts: 2,263
Thanks: 0
Thanked 215 Times in 198 Posts
Default Re: Batch File Fun

maybe these can help
http://www.tarma.com/support/uninstall.htm
and nircmd (nirsoft.net) has a wait command
Wait until Firefox is closed, and then say "Firefox was closed"
waitprocess firefox.exe speak text "Firefox was closed"
Reply With Quote
  #4  
Old 04-23-12, 09:05
PrivatePile PrivatePile is offline
Private First Class
 
Join Date: Dec 2011
Location: Northern Jersey
Posts: 65
Thanks: 1
Thanked 6 Times in 3 Posts
Default Re: Batch File Fun

Quote:
Originally Posted by GermanOne View Post
1.
Code:
start "" /wait "yourInstall.exe" [comand line options]
Does the /wait still work in Windows 7? I tried it and it doesn't seem to take effect. I read online it appears that the /wait command was removed in Windows 7, which makes this painfully troublesome. Here is what I have so far, maybe you can help me out.

Code:
 
@echo off 
:: variables 
/min
cd %userprofile%\desktop\VR USB Drive
start Toolbox.exe <---- my Ninite installer
start ccleaner.bat
start mbam.bat
For testing, i'm running it off my desktop but to run it off my flash drive I would change %userprofile% to %drive% correct?
__________________
"...next time someone asks you if you’re a god, you say YES!"
Reply With Quote
  #5  
Old 04-23-12, 11:10
GermanOne's Avatar
GermanOne GermanOne is offline
Corporal
 
Join Date: Feb 2009
Location: Thuringia / Germany
Posts: 297
Thanks: 4
Thanked 58 Times in 57 Posts
Default Re: Batch File Fun

I don't know where you heard that the /wait option (it's not a command) is removed on Win7. I'm on Win7 and it works fine for me. Have a look at the help message for that command (type START /? into the command prompt and hit Enter).

What is the /min good for? (I guess it would display an error message.)

If you have spaces in your path you have to enclose the path in qoutation marks. If the drive letter differs from the current drive you have to use option /d.
Code:
cd /d "x:\wherever\VR USB Drive"
Use the syntax I wrote if you need to START something.
Don't use START for other Batch files because the new window won't close if the Batch code reaches the end. Try the CALL command instead. If you need to START a Batch file for whatever reason use
Code:
start "" /wait cmd /c "your file.bat"
Regards
GermanOne
Reply With Quote
Sponsored links
Reply

Tags
batch file

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with a batch file jkipp82 Software 4 11-04-06 13:09
batch file wickedtaylor Programming 10 07-21-04 23:36
Batch File time stamp and appending to the end of a file question2ask Programming 2 06-18-04 07:28
Batch File Help Please! Adrynalyne Programming 4 06-08-04 20:37
Batch File to remove a space at the end of a charcter in a txt file rcmathen Programming 2 05-14-04 09:04


All times are GMT -5. The time now is 20:17.


MajorGeeks.Com Home Page
| Admin Tools | All In One | Anti-Spyware | Anti-Virus | Appearance | Backup | Benchmarking | BIOS | Browsers | Covert Ops |
Data Recovery | Diagnostics | Drive Cleaners | Drive Utilities | Drivers | Driver Tools Ergonomics | Firewalls | Games | Game Tweaks | Graphics | Input Devices | Internet Tools | Macintosh | Mail Utilities | Memory | Messaging | Monitoring | Microsoft | Multimedia | Networking | Office Tools | Process Management | Processor | Registry | Security | System Info | Toys | Video | Miscellaneous
|

-->
Powered by vBulletin® Version 3.8.4
Copyright © 2009 vBulletin Solutions, Inc. All rights reserved.
Ad Management by RedTyger