Thursday, November 11, 2010
netsh adv cons add rule name="blahblah" [big blah blah]
net stop ikeext & NET start ikeext
Usually, this should stop the service ikeext & then start it again, but it failed to stop the dependent services and thus could not restart. Same sequence works perfect on command prompt.
Add few timeout commands in between and break processing in mulpiple commands. Timeout command is natively available on windows vista onwards.
netsh adv cons add rule name="blahblah" [big blah blah]
TIMEOUT /T 5
net stop ikeext
TIMEOUT /T 15
sc query ikeext | findstr /i RUNNING 2> NUL 1> NUL
IF %ERRORLEVEL% EQU 1 ( NET start "ikeext" ) else ( echo "ikeext service already running" )
Wednesday, November 3, 2010
- Net localgroup Administrators | findstr /i UserName1 > NUL & IF %ERRORLEVEL% NEQ 0 ( net localgroup Administrators UserName1 /ADD )
- Net Share | findstr /i %SystemDrive%\Temp | findstr /i my > NUL & IF %ERRORLEVEL% NEQ 0 ( net share My=%SystemDrive%\Temp /GRANT:Users,FULL )
- Applicable vista onwards.
- DIR C:\Temp\WinTest-*.log 2> NUL 1> NUL & IF %ERRORLEVEL% EQU 0 FOR %I in (C:\Temp\WinTest-*.log) do ICACLS %I /grant EveryOne:(F)
There will definitely be Powershell, WMI and Vbscript way of doing same thing, but sometimes we do need CMD commands.
Wednesday, October 13, 2010
- Adobe is adding too much junk in our recycle bin folders. It is seriously hampering the work by reducing HDD available size heavily.
- When seeing downloaded videos like NPTEL from YouTube, it is good to use a wireless headphone. Keep laptop away and turn off wireless service. This way a good video can be finished much quicker than the laptop kept nearby. This becomes possible due to avoidance of constant itching to use internet and neck being in comfortable position.
- Facebook is so ubiquitous that it is appearing even on restaurant menus. And even on http://licindia.in, an insurance company, homepage. Google must be having real tough time seeing first big loss on online space where they were first movers.
- When installing new OS, it is better to remove secondary HDD from machine. I am stuck with an IDE drive on machine that cannot be removed since SATA based OS has its boot loader on IDE drive.
- In India, it is good to open your PC every 2nd month and clean cabinet fan and SMPS fan. SMPS fans are inside the warranty seal, but if it is Rs 400-500 one, then why to bother with warranty. Dirt accumulated on them made PC makes too much noise. Do general brushing on other parts also.
- Regularly use DVD writer, else they will fail when you really need them.
- All available indications shows that WP7 will continue to be also-ran, but no market leader in near future.
- Recent DDR3 & N455 powered netbooks are high on performance, but not on battery power compared to widespread DDR2 N450 powered ones.
Sunday, October 10, 2010
I have a 3 HDD machine now, one of which is IDE drive. IDE drive is original drive on machine. Other two are SATA drives. Even though no OS exists on IDE drive as well as both drives in it are formatted, windiws continue to keep critical boot loading files in this hard disk. Removing this results in boot failure. I am still searching for the soultion after banging my head for around 8 hours. Lets see when that solution comes? Some blog post are offering solutions, but need to be in correct bend of mind to pursue them.
Unable to recognize USB ports.
Once I attached 3rd HDD which is SATA, windows stopped recognizing any USB ports except those used for mouse & keyboard. All front and back USB went bad and haywire. FInally, I had to go into BIOS and do "Load default optimized settings" which turned off VT support. This is intel DP8545SG motherboard. But, USB started getting recognized after that. After that, I enabled VT support and things are still fine. Let see how long, since seagate manager still has issue recognizing external HDD when opened. Some delay seems to be there.
But, rediff could seriously do with some good PMs and testers. Just asking users to tryu after a while when it is cookie expired issues is really bad designing.
Monday, September 13, 2010
Shutdown /r /f
Both of these failed with "Access denied" error. In case of API, OpenProcessToken returned the error. OpenProcessToken is first step to acquire privilege SE_SHUTDOWN_NAME. Access denied error in this API. Obvious answer is to use impersonation APIs and then attempt. Still same failure. It seems simple impersonation cannot help acquire required permissions, even in server 2003 & XP.
Next attempt was to check some sysinternal tool to be able to reboot. Mind it, I know all passowrds in plaintext as it is test automation. Even PsShutdown tool had same issue.
Finally, A hacky solution was found and that is add our standard user to "Backup operators" group which can be easily done through the API "NetLocalGroupAddMembers". Problem solved. No security issues either and achieved my shutdown work within same application.
Sunday, May 16, 2010
I had this issue since last 2 months. On rebooting the machine, network address was not getting acquired. Airtel probably made some setting change and my connection got screwed up.
To get around the issue, I was running below power shell script on reboot every time. Since it needs to be run as administrator, there is no point putting it as login script. A pain for long time. Or manually, I needed to disable and enable network interface to get network address.
Today, while fixing some other issue, I tried Airtel NetXpert trouble-shooter randomly and issue got fixed !!! Airtel NetXpert is @ "E:\Program Files (x86)\Airtel\NetXpert\agent\bin\bcont.exe" /p nxpclient” in my x64 system. Most of the people may have it @ “C:\Program Files\Airtel\NetXpert\agent\bin\bcont.exe" /p nxpclient”.
In windows 7 & windows vista, it will require to be run from inside administrator login. This is bad design choice, but anyway.
Run it when there is no network available. That should show below screens in succession
Be patient with “Connection detection” screen and very soon you will see this screen offering to reset your network connection. Allow it to do so and done. Reboot machine to believe yourself.