Content Type
Profiles
Forums
Events
Posts posted by HØLLØW
-
-
Hey Scripting-Heroes
I need to do the following in a Batch-Script (YES, it has to be Batch...!).
I have 2 files with this sample content:
line1line2line3line4
line5line6line7line8
I need a Batch-Script that runs to these 2 files, read the lines and the give this output:
line1,line5line2,line6line3,line7line4,line8
Is this possible???
Thank you!!!
0 -
But also tested on a physical server - Not working...
Is this a bug? I think it should nothing have to do if it's a virtual or physical server?!!!
0 -
What is the motherboard?
Hi,
It's a virtual system
0 -
Any other ideas out there? Or someone who can test it?
0 -
disable the GUIBoot with msconfig
Hi, already tested before: No changes, just the little loading-circle at system-boot is removed...
0 -
Try bootmenupolicy
bcdedit.exe /set {default} bootmenupolicy legacy
or
bcdedit.exe /deletevalue {default} bootmenupolicy
Tested: NOT WORKING...
Here is the list of switches for BCDEdit including Server 2012. My Server 2012 runs headless so I wouldn't be able to test on mine.
I already knew this list
0 -
Hey Guys,
just a short question:
In my Windows Server 2012 configuration-script, I set the following two options:
bcdedit /set {current} bootlog yes
bcdedit /set {current} sos on
Both options are then enabled in the "msconfig" screen.
Also, the "bootlog" works fine - The logfile is written to "C:\Windows\ntbtlog.txt".
But the problem is, that the "sos" option which should show the drivers loaded during startup / boot are not shown on the screen...
Any ideas?
Thank you
0 -
Hi,
I'm also interested in which packages you mean and how you'd removed them?
0 -
Hi again,
no, I'm just working on some finetuning - So if there's no solution, it's not a big problem for me ;-)
Thanks
0 -
Hi,
thanks for your reply.
Yes, I know that restart is the default option but I'm wondering why there is this reboot-counter and how to get rid of it?
Shutdown is not an option for me in this case ;-)
0 -
-
Sure. But what about if there are 2 empty lines at the end?
As I said:
So how can I remove this empty line at the end of my logfile? - I think there will be a solution to remove all empty lines without counting te total line numbers before!?I'll test it and give you feedback.
Thanks
0 -
Hi again :-)
Thank you - Now I got it and it's working very well.
Just one thing:
I modified your script to
select -skip 4
So I get a very clean list of just the cluster names - Is it possible to also skip the last line (because it's empty)?
EDIT:
Sorry,
I checked my script again and noticed that the last line is an empty line that Powershell doesn't count!?
I' running the following command to get the total line numbers:
$linecount = (Get-Content $getclusterlog_clean).Count
write-host $linecountThis gives me the number "63" - If I open "$getclusterlog_clean" there are 64 lines (the last one is empty as I said before).
So how can I remove this empty line at the end of my logfile? - I think there will be a solution to remove all empty lines without counting te total line numbers before!?
0 -
Hi CoffeeFiend,
thanks for your reply - I'm not sure if I explained my problem detailed enough...
I need to fill a variable called "$vmcluster" with the names of the cluster - I think this should be done in a loop!?
I want to run my defined function for every cluster in the list:
function disableesxhostmonitoring {
# Disable the Cluster-Option "Host Monitoring"
$spec = New-Object VMware.Vim.ClusterConfigSpecEx
$spec.dasConfig = New-Object VMware.Vim.ClusterDasConfigInfo
$spec.dasConfig.hostMonitoring = "disabled"
$_this = Get-Cluster $vmcluster | Get-View
$_this.ReconfigureComputeResource_Task($spec, $true)
}0 -
Hey Guys,
I'm working with Powershell for a few days now - It's totally new to me (I know you already heard that so many times before... :-)).
I already have the base of my script - But now I have to do the following:
I have a text-file / logfile that looks like this (as you can see - I'm using PowerCLI from VMware, but I think this is a general Powershell question :-)):
Name HAEnabled HAFailover DrsEnabled DrsAutomationLevel
Level
---- --------- ---------- ---------- ------------------
cluster1 True 1 True FullyAutomated
cluster2 True 1 False FullyAutomated
cluster3 False 1 False FullyAutomated
123442 True 1 False FullyAutomated
server23 True 0 False FullyAutomated
test123 False 1 False FullyAutomated
abcd False 1 False FullyAutomatedI think we have to cut off all the lines which are not necessary for the script?! - This will be the first 5 lines of the logfile and the stuff behind the cluster-names.
The next step will be to fill up a variable with the names of the clusters (in the first column) - I think this must be done in a loop?!
The script should be flexible so I will run a special command for each server / cluster:
function disableesxhostmonitoring {
# Disable the Cluster-Option "Host Monitoring"
$spec = New-Object VMware.Vim.ClusterConfigSpecEx
$spec.dasConfig = New-Object VMware.Vim.ClusterDasConfigInfo
$spec.dasConfig.hostMonitoring = "disabled"
$_this = Get-Cluster $vmcluster | Get-View
$_this.ReconfigureComputeResource_Task($spec, $true)
}I hope someone can help.
Thanks
0 -
Hi,
I solved the problem using the following command:
SetACL.exe -on "HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -ot reg -actn ace -ace "n:Administrators;p:full"
0 -
Hey guys out there,
I need help with the "REG QUERY" command
I have to edit the following REG-Keys:
"MouseSpeed"="0"
"MouseThreshold1"="0"
"MouseThreshold2"="0"The "Master-Key" is the following:
HKEY_USERS\S-1-5-21-XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXXX-500\Control Panel\Mouse
The "problem" is, that the numbers I marked with "X" are changing on every new OS-Installation.
So I have to use the "REG QUERY" command tho determine the REG-Key!
For antoher operation with "REG QUERY" I'm using the following command:
@FOR /F "DELIMS=" %%? IN ('REG QUERY HKLM\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318} /S^|FINDSTR \\Connection$') DO @REG ADD "%%?" /V ShowIcon /T REG_DWORD /D 1 /F >NUL
But what about the syntax? I'm sorry but I don't understand it completely...
So can anyone help me getting the right syntax for the operation I have to do?
Thank you
0 -
Yes i want to run the file only once and i can't use the Startup folder in Startmenu because i don't want to loss the Recovery Console option.
You just have to do an "XCOPY-Command" of your batch to the Startup-Folder in Startmenu and delete it afterwards if you want the script just to run once and not on every login...
0 -
Would you like to run the file just once or what?
You can put it in the Startup folder in Startmenu to run it after login...
0 -
Ok, thank you guys.
0 -
[uPDATE]
I resolved the problem and found a solution for that.
I'm now using "sed.exe" from the "UnxUtils" to find the string and replace it by another.
But it would be very nice to know how to do this without any 3rd party tool...
0 -
Hey ho,
I also need a solution for a similar problem:
I have a file with 610 lines of code. In exactly line 347 I have to add some characters between "><" :
<DATA Type="xsd::string">%MYOWNCHARACTERS%</DATA>
Can you give me the code I need for a batch-file to do this job?
I'm not so familiar with the commands in batch to do this job, and know I have to study it B)
Thank you very much
0 -
Hmmm -- seems regini can change perms, but not take any ownership (and has some limitations on HCKR as well). At this point, I'd recommend SetAcl to overcome this particular limitation - it's 32 and 64bit and quite small.
Hi there,
I tested it today on my test-environment and it worked fine with "SetACL".
Very nice tool
Thank you guys
0 -
Umm, regini?
and just to clarify. Cluberti is not asking what regini is, he is saying that regini is included in W2K8-R2.
Sorry, my mistake
I tested it with the following:
HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D} [1]
That's not working! Administrator has just read-access!
Is there a way to change te owner of the key via commandline? Because then it's working fine
0
Loop to 2 files and echo the lines together ("array"!?)
in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Posted
Ok thank you guys!
It works fine for now - But I tried to modify the script to get it working with multiple files, no chance for me...
So is it possible to get it working with more than 2 files?
In my case there are 3 scenarios I need this:
The output should be the same as described in this topic.
Thank you!!!