Search found 20 matches
- 19 Dec 2015 12:55
- Forum: DOS Batch Forum
- Topic: Stopping services, restarting services(safemode)
- Replies: 17
- Views: 15670
Re: Stopping services, restarting services(safemode)
To complete this topic, I created a batch that disables all but a few necessary services. It is similar to safe mode. It has been a great success and allows us to install programs to scan. An alternative we have found was a little utility that enabled services in safe mode to allow installations. We...
- 02 Feb 2015 19:35
- Forum: DOS Batch Forum
- Topic: Batch to kill installer process to move on with the script..
- Replies: 3
- Views: 4062
Re: Batch to kill installer process to move on with the scri
I did this several times when a program has a switch for silent install, then I learned to make a shortcut to the program and put the switches in the shortcut.
- 01 Feb 2015 17:44
- Forum: DOS Batch Forum
- Topic: Browse folder names only no path and put in text file
- Replies: 4
- Views: 4359
Re: Browse folder names only no path and put in text file
I figured it out! This gives me only the Folder name (no path) and saves it to a text file for later use. for /f "tokens=*" %%i in ('dir "%userprofile%\Documents\" /ad /b') do ( choice /c yn /m "Exclude Folder [%%i]? if errorlevel 2 else ( echo %%i>>%~dp0exclude.txt ) )
- 01 Feb 2015 15:58
- Forum: DOS Batch Forum
- Topic: set /p choice /t prompt? correct format
- Replies: 4
- Views: 4961
Re: set /p choice /t prompt? correct format
Thank you, that was simple enough.
Is there a way to use the Set /p so I can test Y or N instead of errorlevel?
Is there a way to use the Set /p so I can test Y or N instead of errorlevel?
- 01 Feb 2015 15:37
- Forum: DOS Batch Forum
- Topic: Browse folder names only no path and put in text file
- Replies: 4
- Views: 4359
Re: Browse folder names only no path and put in text file
Thanks but that just posted "Exclude folder [%%~nxA]
- 01 Feb 2015 14:48
- Forum: DOS Batch Forum
- Topic: Browse folder names only no path and put in text file
- Replies: 4
- Views: 4359
Browse folder names only no path and put in text file
I have a utility using xcopy excludes some folder or files. The plan is to display each folder and ask if you would like to exclude it from the backup. This is as far as I could get; for %%f in ("%userprofile%\Documents\*") do ( choice /c yn /m "Exclude Folder [%%~dpnxf]? " if er...
- 01 Feb 2015 14:38
- Forum: DOS Batch Forum
- Topic: set /p choice /t prompt? correct format
- Replies: 4
- Views: 4961
set /p choice /t prompt? correct format
I haven't found a good choice example on the web. I had to format it like this. Can anyone get the message in line with the choice option; echo Would you like to set folders to exclude? CHOICE /T 4 /C ync /CS /D n if errorlevel=3 goto variables if errorlevel=2 goto backup if errorlevel=1 goto exclud...
- 10 Nov 2014 19:18
- Forum: DOS Batch Forum
- Topic: Find OS
- Replies: 6
- Views: 8759
Re: Find OS
Aacini, is there a way to just save the Version number so I can just go to version @echo off setlocal EnableDelayedExpansion ::Identify OS for /F "delims=" %%a in ('ver') do set ver=%%a set Version= for %%a in (95=95 98=98 ME=ME NT=NT 2000=2000 5.1.=XP 5.2.=2003 6.0.=Vista 6.1.=7 6.2.=8 6....
- 10 Aug 2012 11:17
- Forum: DOS Batch Forum
- Topic: Stopping services, restarting services(safemode)
- Replies: 17
- Views: 15670
Re: Stopping services, restarting services(safemode)
Liviu, That seem to work well. I put some pauses in it so I can see it as it works. Is there a way to >> push the disabled ones into a text file, then start disabled.txt I want to stop those currently running, and disable them from restarting. Of course I will need to list AV services as to not disa...
- 07 Aug 2012 11:12
- Forum: DOS Batch Forum
- Topic: Stopping services, restarting services(safemode)
- Replies: 17
- Views: 15670
Re: Stopping services, restarting services(safemode)
Didn't mean to sound like your not welcome to discuss the code, but fawers was on target with the code. Just needs some tweaking. I'm not discussing the practicallity of what I'm doing. It works great for me, and have had great sucess in all our satellite offices. Just automating what I am doing now...
- 07 Aug 2012 07:37
- Forum: DOS Batch Forum
- Topic: Stopping services, restarting services(safemode)
- Replies: 17
- Views: 15670
Re: Stopping services, restarting services(safemode)
Also, is there a way to skip the last line when writing to a text file or reading from one? These all include the line "comman completed sucessfully"
I though after tokens you add -1, but it did not work.
I though after tokens you add -1, but it did not work.
- 07 Aug 2012 06:04
- Forum: DOS Batch Forum
- Topic: Stopping services, restarting services(safemode)
- Replies: 17
- Views: 15670
Re: Stopping services, restarting services(safemode)
Fawers, I added this bit of code before to list the services running so I would have them all listed, then turn off those. I get a message that the specified service does not exist. @echo off color 0A MODE CON: COLS=90 LINES=50 title List services :list ::list services currently installed for /f &qu...
- 07 Aug 2012 05:43
- Forum: DOS Batch Forum
- Topic: Stopping services, restarting services(safemode)
- Replies: 17
- Views: 15670
Re: Stopping services, restarting services(safemode)
This discussion is with Fawers. No the program isn't turning any services off. It's stopping before it does anything. I know what net starts is. I've never seen it referenced to as though it was a file. Yes there is a safe list found here m I already have registry entry that sets the windows service...
- 06 Aug 2012 20:47
- Forum: DOS Batch Forum
- Topic: Stopping services, restarting services(safemode)
- Replies: 17
- Views: 15670
Re: Stopping services, restarting services(safemode)
I tried your code for disabling services and couldn't get it to work. I saw a black screen then it went off.
It is difficult to troubleshoot.
I want to have a list of services to keep.
What is 'net start' referring to?
It is difficult to troubleshoot.
I want to have a list of services to keep.
What is 'net start' referring to?
- 06 Jun 2012 22:00
- Forum: DOS Batch Forum
- Topic: Stopping services, restarting services(safemode)
- Replies: 17
- Views: 15670
Re: Stopping services, restarting services(safemode)
It won't matter which list is bigger, but the keepers IS shorter. The ones you want to shut off are unknown services. Some are valid and some are trojans or fake services. I'll try this out tomorrow. Thanks! Is it possible to do the same thing with processes? I don't want to turn off svchost (we've ...