Search found 14 matches
- 11 Jul 2017 02:04
- Forum: DOS Batch Forum
- Topic: Finding the DNS suffix...
- Replies: 12
- Views: 10764
Re: Finding the DNS suffix...
Merlin, might I suggest this then to retrieve the part of the suffix you need. @Echo Off For /F "Skip=1 Delims={}" %%A In ( 'WMIC NICConfig Where "IPEnabled='TRUE'" Get DNSDomainSuffixSearchOrder' ) Do For %%B In (%%A) Do If /I "%%~xB"==".internal" For %%C In...
- 10 Jul 2017 04:30
- Forum: DOS Batch Forum
- Topic: Finding the DNS suffix...
- Replies: 12
- Views: 10764
Re: Finding the DNS suffix...
Compo, If I understand correctly, your script is scanning the registry for the suffix and then outputting that into a var? I wasn't able to pick up the suffix with your script, but I would like to get it working. It's a whole new concept to me; picking up the info' from the registry via batch. You ...
- 10 Jul 2017 01:57
- Forum: DOS Batch Forum
- Topic: Finding the DNS suffix...
- Replies: 12
- Views: 10764
Re: Finding the DNS suffix...
I didn't test it but I assume this code should work in both cases. for /f "tokens=1* delims=:" %%i in ('ipconfig^|findstr /ec:"compute.internal"') do ( if "%%j"=="" ( for /f "delims=. " %%k in ("%%i") do set "var=%%k" ) else ( fo...
- 07 Jul 2017 03:35
- Forum: DOS Batch Forum
- Topic: Finding the DNS suffix...
- Replies: 12
- Views: 10764
Re: Finding the DNS suffix...
That line might be working for you: for /f "tokens=1* delims=:" %%i in ('ipconfig^|findstr /ec:"compute.internal"') do for /f "delims=. " %%k in ("%%j") do set "var=%%k" Variable %var% should contain what you're looking for. Steffen Hi Steffen, This...
- 04 Jul 2017 00:57
- Forum: DOS Batch Forum
- Topic: Finding the DNS suffix...
- Replies: 12
- Views: 10764
Re: Finding the DNS suffix...
aGerman, Lovely stuff! Thank you. Compo, If I understand correctly, your script is scanning the registry for the suffix and then outputting that into a var? I wasn't able to pick up the suffix with your script, but I would like to get it working. It's a whole new concept to me; picking up the info' ...
- 03 Jul 2017 08:04
- Forum: DOS Batch Forum
- Topic: Finding the DNS suffix...
- Replies: 12
- Views: 10764
Re: Finding the DNS suffix...
ShadowThief wrote:Does the x part contain any periods?
Hi Shadow,
No periods, just hyphens.
- 03 Jul 2017 07:52
- Forum: DOS Batch Forum
- Topic: Finding the DNS suffix...
- Replies: 12
- Views: 10764
Finding the DNS suffix...
Hi everyone, I've spent an inordinate amount of time on what I'm sure should be a fairly trivial matter... If I run an IPconfig on my target machine, the line I'm interested in is this: Connection-specific DNS Suffix . : xx-xxxx-xx.compute.internal NB! x can vary in length, i.e.: xx-xxxxxxx-xx I've ...
- 30 May 2017 02:57
- Forum: DOS Batch Forum
- Topic: WBAdmin (Windows Server Backup) automation, with local drive rules...
- Replies: 14
- Views: 12929
Re: WBAdmin (Windows Server Backup) automation, with local drive rules...
I don't believe that the C: drive is being included due to an error in any of my coding, more because of the options you have included with your backup command. Have you considered removing one or both of the -allCritical and -systemState options as they both have relationship to the system state a...
- 29 May 2017 05:54
- Forum: DOS Batch Forum
- Topic: WBAdmin (Windows Server Backup) automation, with local drive rules...
- Replies: 14
- Views: 12929
Re: WBAdmin (Windows Server Backup) automation, with local drive rules...
What happens if you use the first code example I provided? it was designed to specifically ignore the C: drive! Hi Compo, My apologies for the delay in responding to this. I've been in hospital and then on rest leave. I've tried the first code example both with and without delayed expansion. No mat...
- 17 May 2017 05:45
- Forum: DOS Batch Forum
- Topic: WBAdmin (Windows Server Backup) automation, with local drive rules...
- Replies: 14
- Views: 12929
Re: WBAdmin (Windows Server Backup) automation, with local drive rules...
@Merlin, I have updated the code in my previous post to hopefully fix the error message you were receiving. Thanks Compo. It's working, and I am delighted. Thank you for your persist assistance with this. It is greatly appreciated. It is, however, unfortunately including %SystemDrive% (read: C:) in...
- 16 May 2017 08:06
- Forum: DOS Batch Forum
- Topic: WBAdmin (Windows Server Backup) automation, with local drive rules...
- Replies: 14
- Views: 12929
Re: WBAdmin (Windows Server Backup) automation, with local drive rules...
Compo, That is fantastic! Thank you. Using the last of your examples, I have made the recommended changes, to avoid using Delayed Expansion. @Echo Off SetLocal EnableExtensions EnableDelayedExpansion Set "RemoteBackUp=D:" Echo=Checking for existing drives... Echo= Set "_HDL=" For...
- 16 May 2017 02:33
- Forum: DOS Batch Forum
- Topic: WBAdmin (Windows Server Backup) automation, with local drive rules...
- Replies: 14
- Views: 12929
Re: WBAdmin (Windows Server Backup) automation, with local drive rules...
Hi everyone, Thanks for the input. At present, the file is named TEST. I have tried running it by double-clicking it and by running it through a CMD window, using both .bat and .cmd extensions, on a virtualised Windows 2008 R2 Datacenter Server installation. All present the same issue. I have amende...
- 15 May 2017 02:01
- Forum: DOS Batch Forum
- Topic: WBAdmin (Windows Server Backup) automation, with local drive rules...
- Replies: 14
- Views: 12929
Re: WBAdmin (Windows Server Backup) automation, with local drive rules...
Hi Steffen, Many thanks for your assistance. When I try to run the batch file on the server, it loops through an error... Found D: Maximum setlocal recursion level reached. @echo Off SETLOCAL ENABLEEXTENSIONS SETLOCAL ENABLEDELAYEDEXPANSION REM Title title My title goes here. REM Colour color 0A REM...
- 11 May 2017 07:21
- Forum: DOS Batch Forum
- Topic: WBAdmin (Windows Server Backup) automation, with local drive rules...
- Replies: 14
- Views: 12929
WBAdmin (Windows Server Backup) automation, with local drive rules...
Hi everyone, I've been tasked with a massive automation project, of which WBAdmin is a small part of it. I've been trawling Google for two days now, finding snippets to assist with this. I am an amateur batch programmer and often rely on bits & pieces to help compile my own, tailored scripts. Th...