Tuesday 14 October 2014

Elevated command prompt tip

Enter the word "command" in the search bar, instead or pressing enter press "Ctrl - Shift - Enter", this brings up UAC and asks for an admin password.

I used this in my other post:
http://asdirkseesit.blogspot.co.uk/2013/06/how-to-view-group-policy-preferences-on.html
(see addendum section)

Mentioned here

http://www.howtogeek.com/howto/windows-vista/run-a-command-as-administrator-from-the-windows-vista-run-box/



Wednesday 9 July 2014

Advanced XML filtering windows event viewer

Nice link here:

http://blogs.technet.com/b/askds/archive/2011/09/26/advanced-xml-filtering-in-the-windows-event-viewer.aspx

Contains stuff that helps narrow down event filtering on win server

      <QueryList>
           <Query Id="0">
              <Select Path="Security">
                 *[EventData[Data[@Name='SubjectUserName'] and (Data='test9')]]
               </Select>
           </Query>
      </QueryList>


Much better than usual limiting filters

Tuesday 8 July 2014

Network issues and ping returns strange characters

Had some issues with computer not working correctly on the network. Could not ping NetBIOS name, so presumed it was a DNS issue.

Then whilst pinging ip address I noticed weird ascii characters were returned
http://www.pcreview.co.uk/forums/strange-characters-ping-results-t248058.html

I was led to doing another "netsh winsock reset catalog" command and this resolved it.


Friday 13 June 2014

Avrdude atmel studio integration

These are notes for using Avrdude with Atmel Studio. They need more context just like the links provide.

I will add more detail hopefully soon, just in case the links go dead.

Watch for "  the inverted commas, I had some issue with these.

Guide:
  1. Select Tools > External Tools
  2. Then fill the details in window as show in the screenshot




########### Workings out for setting avrdude in Atmel Studio ####
for use with assembler uploading hex file
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=1158681
http://asensar.com/2013/06/23/programming-arduino-using-avrdude/
http://asensar.com/2013/06/23/how-to-integrate-avrdude-with-atmel-studio/


### initial output from Arduino

Binary sketch size: 1,084 bytes (of a 32,256 byte maximum)
\\path\Arduino
\hardware/tools/avr/bin/avrdude -C\\path
\Arduino\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P\
\.\COM6 -b115200 -D -Uflash:w:C:\Users\user\AppData\Local\Temp
\build4700042702866457239.tmp\Blink.cpp.hex:i


## simplifying the above output

avrdude -C\\path\Arduino
\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P\\.\COM6
-b115200 -D -Uflash:w:<myhexfile>:i

uno.name=Arduino Uno
uno.upload.protocol=arduino
uno.upload.maximum_size=32256
uno.upload.speed=115200
uno.bootloader.low_fuses=0xff
uno.bootloader.high_fuses=0xde
uno.bootloader.extended_fuses=0x05
uno.bootloader.path=optiboot
uno.bootloader.file=optiboot_atmega328.hex
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.core=arduino
uno.build.variant=standard

## copy of other chaps. needed tweaking. paths etc

-F -v -patmega328p -carduino -P.COM6 -b115200 -D -Uflash:w:"$(ProjectDir)Debug\
$(ItemFileName).hex":i -C\\path\Arduino
\hardware/tools/avr/etc/avrdude.conf

Wednesday 15 January 2014

Append a Location to the Path Environment Variable using vbscript

http://blogs.technet.com/b/heyscriptingguy/archive/2006/08/28/how-can-i-append-a-location-to-the-path-environment-variable.aspx


strComputer = "." <----- or changes this "." to computer name e.g. "computer-01"

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery _
    ("Select * From Win32_Environment Where Name = 'Path'")

For Each objItem in colItems
    strPath = objItem.VariableValue & ";C:\Scripts\"
    objItem.VariableValue = strPath
    objItem.Put_
Next

Tuesday 25 June 2013

re-install a package installed by group policy

Seems I cannot reinstall a program using group policy when the program has been originally rolled out by group policy, even when it has been uninstalled on the machine by an admin user

see here

http://www.frickelsoft.net/blog/?p=103

seems I must delete registry key to allow for the package to be reinstalled via group policy

Simply delete corresponding key from:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\AppMgmt

NOTE: Don't delete the actual AppMgmt key, explode the key to see the GUIDs, if you click on one it will then give you the details so you can ascertain which GUID relates to which software. Then delete the whole key relevant.

And another example here http://www.mysysadmintips.com/windows/active-directory/210-force-applications-to-be-re-installed-by-group-policy

Copy file to multiple PCs with group policy

I used this example:
http://www.silentcrash.com/2012/06/copy-files-multiple-computers-group-policy-gpo/

main thing being that the file needed to be a .cmd extension

I also changed the switch to overwrite current file without prompting
Xcopy \\server\netlogon\scratch.ini "C:\Program Files\Scratch\" /Y

I used netlogon but not sure its needed, had a few issues trying to use a .vbs file initially.