Wednesday, August 16, 2017

Reset windows folder sharing access (reset users connection)

Reset windows folder sharing access (reset users connection)

https://serverfault.com/questions/56744/how-do-i-reset-my-network-share-permissions
https://technet.microsoft.com/en-us/library/cc725598(v=ws.11).aspx


c:\windows\system32\NET.exe SESSION /DELETE /Y

Wednesday, June 28, 2017

Dos for loop with delay

Command below performing 1000 iterations printing number with 1 second delay interval

for /l %i in (1,1,1000) do timeout /t 1 > nul| echo %i

Additional refer:
https://hubpages.com/technology/How-to-Make-A-Windows-Batch-File-Loop-Sleep-or-Delay-For-Specific-Interval-of-Time

Tuesday, June 13, 2017

Files become shortcuts issue (virus)


https://www.easeus.com/file-recovery/recover-files-infected-by-shortcut-virus.html

Solution 1. Recover shortcut files using CMD

If the flash drive is not formatted, the shortcut files must have been stored in the hardware in hidden mode. You can recover them using CMD by following these steps:
  1. 1. Go to Start -> Run -> cmd.
  2. 2. Go to your pen drive, memory cards or mobile phone directory.
  3. 3. Type del *.lnk (to delete all link files in the directory)
  4. 4. Type attrib -h -r -s /s /d e:*.*
  5. Launch EaseUS data recovery software to recover files from Toshiba laptop
  6. 5. Replace G with your drive letter.
  7. 6. And then press a gentle Enter.
Finish all these steps you can check for your files in on the pen drive. If you can’t find the files you want, you can try another solution: recover shortcut files with EaseUS data recovery software.

Friday, June 9, 2017

Turn off Test Build Windows for valid Win OS user


1. Click Start, and then type cmd in the Search box.
2. Under Programs, right-click cmd.exe, and then click Run as administrator.
3. At the command prompt, type the following text, and then press Enter: bcdedit /set TESTSIGNING OFF.
4. Close the Command Prompt window, and then restart your computer.

Disable Chrome Homepage setting locked

1. Find HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Polices
2. delete chrome key


Saturday, November 12, 2016

Java regular expression in Android dumpsys pattern matching

Objective: Extract dumpsys information and read the RSSI / signal strength value

// Dumpsys to grep the signal message
String signalValueText = "";
String dumpsys_log = Android.adbCommand(device, "adb -s " + Android.getSerialNumber(device) + " shell dumpsys telephony.registry | grep mSignalStrength=SignalStrength");
sleep(500);

// set regular expression to match pattern 
String pattern = "(.*)(SignalStrength:) (\\d{1,3}) (\\d{1,3}) -(\\d{1,3}) -(\\d{1,3}) -(\\d{1,3}) -(\\d{1,3}) -(\\d{1,3}) (\\d{1,3}) -(\\d{1,3}) -(\\d{1,3}) (\\d{1,3}) (\\d+) (\\d+) (gsm)(.*)";

// Create search pattern object
Pattern r = Pattern.compile(pattern);

// match the pattern and acquire right value, Extract all digits value from the string
Matcher m = r.matcher(dumpsys_log);
   if (m.find( )) {
    signalValueText = m.group(11);
   }else {
       Android.sequenceFail(deviceId, "dumpsys log NO match found! - FAILED");
   sleep(500);
   }
   
int signalValue = Integer.parseInt(signalValueText);
if (signalValue <100 amp="" signalvalue=""> 50)
{
System.out.println("Signal Strength = -" + signalValue);
sleep(500);
}
else 
{
System.out.println("Signal Strength range verification - FAILED, Current value = -" + signalValue);
sleep(500);
}

Tuesday, October 25, 2016

First AutoIt v3 script mouse click by coordinate creation

This script below will look 1000 times by clicking the 2 continuous mouse positions

Opt("Windows Title", 2)

For $i = 1 To 1000
$pos = WinGetPos("Windows Title")
$x = 439
$y = 250

WinWaitActive("Windows Title")
MouseClick("left", $pos[0] + $x, $pos[1] + $y)


$x = 371
$y = 304

WinWaitActive("Windows Title")
MouseClick("left", $pos[0] + $x, $pos[1] + $y)

Next