Tuesday, November 20, 2012
UltraVNC can't send Ctrl-Alt-Del
http://kb.realvnc.com/questions/102/
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v SoftwareSASGeneration /t REG_DWORD /d 1 /f
This registry value allows UltraVNC (and others) to send Ctrl-Alt-Del through the installed service. It is also configurable as a policy in gpedit.msc,
.. Computer Configuration
.... Administrative Templates
...... Windows Components
........ Windows Logon Options
.......... Disable or enable software Secure Attention Sequence
............ Enable for "Services".
Thursday, October 11, 2012
Add local admin from command line
net user AdminNWS password /add
These commands create a new user AdminNWS with password "password", add it to the local Administrators group, and then uses WMIC to set the password to never expire. The last line prompts you for a new password for the ID.
On Win7+ you can also take steps to hide the account from the logon screen:
net localgroup Administrators AdminNWS /add
wmic useraccount where "name='AdminNWS'" set PasswordExpires=false
net user AdminNWS *
These commands create a new user AdminNWS with password "password", add it to the local Administrators group, and then uses WMIC to set the password to never expire. The last line prompts you for a new password for the ID.
On Win7+ you can also take steps to hide the account from the logon screen:
REG.EXE ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /V AdminNWS /t REG_DWORD /d 0
(line splits)
Tuesday, September 11, 2012
Batch files do arithmetic
http://ss64.com/nt/set.html
It's the SET command with a /A parameter. Sorry for not knowing this sooner.
You can use SET /? to get generic details, or see the SS64's examples below.
Check out SET /P as well to prompt for a variable.
It's the SET command with a /A parameter. Sorry for not knowing this sooner.
You can use SET /? to get generic details, or see the SS64's examples below.
Check out SET /P as well to prompt for a variable.
The expression to be evaluated can include the following operators:
+ Add set /a "_num=_num+5"
+= Add variable set /a "_num+=5"
- Subtract (or unary)set /a "_num=_num-5"
-= Subtract variable set /a "_num-=5"
* Multiply set /a "_num=_num*5"
*= Multiply variable set /a "_num*=5"
/ Divide set /a "_num=_num/5"
/= Divide variable set /a "_num/=5"
% Modulus set /a "_num=5%%2"
%%= Modulus set /a "_num%%=5"
! Logical negation 0 (FALSE) ⇨ 1 (TRUE) and any non-zero value (TRUE) ⇨ 0 (FALSE)
~ One's complement (bitwise negation)
& AND set /a "_num=5&3" 0101 AND 0011 = 0001 (decimal 1)
&= AND variable set /a "_num&=3"
| OR set /a "_num=5|3" 0101 OR 0011 = 0111 (decimal 7)
|= OR variable set /a "_num|=3"
^ XOR set /a "_num=5^3" 0101 XOR 0011 = 0110 (decimal 6)
^= XOR variable set /a "_num=^3"
<< Left Shift. (sign bit ⇨ 0)
>> Right Shift. (Fills in the sign bit such that a negative number always remains negative.)
Neither ShiftRight nor ShiftLeft will detect overflow.
<<= Left Shift variable set /a "_num<<=2"
>>= Right Shift variable set /a "_num>>=2"
( ) Parenthesis group expressions set /a "_num=(2+3)*5"
, Commas separate expressions set /a "_num=2,_result=_num*5"
If a variable name is specified as part of the expression, but is not defined in the
current environment, then SET /a will use a value of 0.
Friday, August 10, 2012
Great Plains Autologin Macro
http://support.microsoft.com/kb/856496
http://automation-beyond.com/2009/11/12/ms-dynamics-great-plains-macros/
After opening GP but before logging in, use Alt-F8 to record macro, sign in, and exit GP. Edit the new macro file to clean it up. You also should insert a "Logging File" command to avoid the 'OK' at the end of the macro. Here's an example from GP8:
#AutoTestLogin.mac
# DEXVERSION=DEX 8.00
#*** Insert the following line
Logging file ':c:AutoTestLogin.log'
CheckActiveWin dictionary 'default' form Login window Login
MoveTo field '(L) SQL_DataSource' item 5 # 'TestCorp'
ClickHit field '(L) SQL_DataSource' item 5 # 'TestCorp'
MoveTo field 'User ID'
TypeTo field 'User ID' , 'autotestuser'
MoveTo field Password
TypeTo field Password , 'autotestpw'
MoveTo field 'OK Button'
ClickHit field 'OK Button'
NewActiveWin dictionary 'default' form 'Switch Company' window 'Switch Company'
ClickHit field '(L) Company Names' item 1 # 'TestCorp, Inc.'
MoveTo field 'OK Button'
ClickHit field 'OK Button'
http://automation-beyond.com/2009/11/12/ms-dynamics-great-plains-macros/
After opening GP but before logging in, use Alt-F8 to record macro, sign in, and exit GP. Edit the new macro file to clean it up. You also should insert a "Logging File" command to avoid the 'OK' at the end of the macro. Here's an example from GP8:
#AutoTestLogin.mac
# DEXVERSION=DEX 8.00
#*** Insert the following line
Logging file ':c:AutoTestLogin.log'
CheckActiveWin dictionary 'default' form Login window Login
MoveTo field '(L) SQL_DataSource' item 5 # 'TestCorp'
ClickHit field '(L) SQL_DataSource' item 5 # 'TestCorp'
MoveTo field 'User ID'
TypeTo field 'User ID' , 'autotestuser'
MoveTo field Password
TypeTo field Password , 'autotestpw'
MoveTo field 'OK Button'
ClickHit field 'OK Button'
NewActiveWin dictionary 'default' form 'Switch Company' window 'Switch Company'
ClickHit field '(L) Company Names' item 1 # 'TestCorp, Inc.'
MoveTo field 'OK Button'
ClickHit field 'OK Button'
Monday, July 23, 2012
New Folder Context Menu
http://billsway.com/vbspage/
http://billsway.com/vbspage/vbsfiles/NewFolder.zip
http://www.google.com/#q=fldrjazz.zip
Traditionally missing from XP and earlier is a right-click context menu option for folders to create a new subfolder. For years I've been using FolderJazz, an abandoned program that is now difficult to find if you don't know the short name "fldrjazz.zip". The ZIP has three files, including an EXE for which the source is unavailable. The original website and company are both gone.
Though I still trust FolderJazz implicitly, I found that Bill James has developed (a decade ago) an elegant single all-in-one VBS that provides exactly the same functionality in a single WSH 2.0 file that installs the menu, uninstalls, and gets called to make the folder. And it's easier remembering "billsway" than finding one of the ever-dwindling copies of FolderJazz.
http://billsway.com/vbspage/vbsfiles/NewFolder.zip
http://www.google.com/#q=fldrjazz.zip
Traditionally missing from XP and earlier is a right-click context menu option for folders to create a new subfolder. For years I've been using FolderJazz, an abandoned program that is now difficult to find if you don't know the short name "fldrjazz.zip". The ZIP has three files, including an EXE for which the source is unavailable. The original website and company are both gone.
Though I still trust FolderJazz implicitly, I found that Bill James has developed (a decade ago) an elegant single all-in-one VBS that provides exactly the same functionality in a single WSH 2.0 file that installs the menu, uninstalls, and gets called to make the folder. And it's easier remembering "billsway" than finding one of the ever-dwindling copies of FolderJazz.
Tuesday, July 10, 2012
DOS batch string manipulation
http://www.dostips.com/DtTipsStringManipulation.php
And there's also command processor batch file variable manipulation, similar to BASIC language string functions. Check the link for more examples. Who knew?!
Left$(envvar,5)=%envvar:~0,5%
Right$(envvar,5)=%envvar,~-5,5%
Mid$(envvar,3,2)=%envvar,~3,2%
Repl(envvar,"old","new")=%envvar:old=new%
(Remove envvar first 2 chars and last 3 chars) = %envvar:~2,-3%
And there's also command processor batch file variable manipulation, similar to BASIC language string functions. Check the link for more examples. Who knew?!
Left$(envvar,5)=%envvar:~0,5%
Right$(envvar,5)=%envvar,~-5,5%
Mid$(envvar,3,2)=%envvar,~3,2%
Repl(envvar,"old","new")=%envvar:old=new%
(Remove envvar first 2 chars and last 3 chars) = %envvar:~2,-3%
Disable Autorun
http://support.microsoft.com/kb/967715
http://windowssecrets.com/top-story/one-quick-trick-prevents-autorun-attacks/
http://nickbrown-france.blogspot.com/2007/10/memory-stick-worms.html
Tired of receiving 2 popups every time I attach my VZW phone to USB to charge, this file "NoAutoRun.reg " covers a few methods of disabling Autorun:
REGEDIT4
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoDriveTypeAutoRun"=dword:000000ff
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer]
"HonorAutoRunSetting"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\Autorun.inf]
@=”@SYS:DoesNotExist”
http://windowssecrets.com/top-story/one-quick-trick-prevents-autorun-attacks/
http://nickbrown-france.blogspot.com/2007/10/memory-stick-worms.html
Tired of receiving 2 popups every time I attach my VZW phone to USB to charge, this file "NoAutoRun.reg " covers a few methods of disabling Autorun:
REGEDIT4
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoDriveTypeAutoRun"=dword:000000ff
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer]
"HonorAutoRunSetting"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\Autorun.inf]
@=”@SYS:DoesNotExist”
It's recommended to reboot after merging....
Monday, June 18, 2012
Virus triggering thru debugger regval
http://www.howtogeek.com/forum/topic/help-with-replacing-taskmgr-with-process-explorer?replies=6
Amazing the amount of places a virus can hook. I cleaned a virus, only to find Task Manager would still not run. It turned out to be a regval "HKLM\SW\MS\WNT\CV\Image File Execution Options" triggering a Debugger for TaskMan. Maybe SpyBot will catch this eventually.
Amazing the amount of places a virus can hook. I cleaned a virus, only to find Task Manager would still not run. It turned out to be a regval "HKLM\SW\MS\WNT\CV\Image File Execution Options" triggering a Debugger for TaskMan. Maybe SpyBot will catch this eventually.
Wednesday, April 25, 2012
VMDebug driver was not enabled.
http://evsearch.deusexmachina.org.uk/doco/event.php?event=53
System log, Source vmdebug, Event ID 3, VMDebug driver (version 7.3.4.3) was not enabled.
reg add HKLM\SYSTEM\CurrentControlSet\Services\vmdebug /v Start /t REG_DWORD /d 4 /f
- or -
REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\vmdebug]
"Start"=dword:00000004
System log, Source vmdebug, Event ID 3, VMDebug driver (version 7.3.4.3) was not enabled.
reg add HKLM\SYSTEM\CurrentControlSet\Services\vmdebug /v Start /t REG_DWORD /d 4 /f
- or -
REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\vmdebug]
"Start"=dword:00000004
Tuesday, April 24, 2012
Use Date and Time in batch file variables and filenames
http://www.intelliadmin.com/index.php/2007/02/create-a-date-and-time-stamp-in-your-batch-files/
http://kennethhunt.com/archives/000933.html
http://ss64.com/nt/syntax-gettime.html
http://sourceforge.net/projects/unxutils/files/
http://stackoverflow.com/questions/203090/how-to-get-current-datetime-on-windows-command-line-in-a-suitable-format-for-us
The FOR command is long known to be useful for parsing the "date /t" command, or output of any command. (Use "FOR /?" for details.) Without going into the development or practice, below is a batch file example for making the string "YYYYMMDD-HHMMSShh".
The Date/Time format varies between OS, so YMMV. I just discovered the first link using the substring ability "~" in environment vars. XP doesn't put the leading "0" on hours in %time%, so I used time /t here. Cut and paste the single long line and you should be fine. Note, the %time% variable changes as you might expect, so you need to set a var if you need consistency throughout the batch file.
Also note the last 2 links regarding a port of the Unix DATE.EXE might make this much simpler, though not built into the O/S.
rem echo %date% %time%
rem date /t
rem time /t
for /f "usebackq tokens=1,2,3* delims=/:. " %%a in (`time /t`) do set now=%date:~-4,4%%date:~4,2%%date:~7,2%-%%a%%b%time:~-5,2%%time:~-2,2%
echo %now%
There's also this version, that works on Windows 2012, relying solely on %date% and %time%:
http://kennethhunt.com/archives/000933.html
http://ss64.com/nt/syntax-gettime.html
http://sourceforge.net/projects/unxutils/files/
http://stackoverflow.com/questions/203090/how-to-get-current-datetime-on-windows-command-line-in-a-suitable-format-for-us
The FOR command is long known to be useful for parsing the "date /t" command, or output of any command. (Use "FOR /?" for details.) Without going into the development or practice, below is a batch file example for making the string "YYYYMMDD-HHMMSShh".
The Date/Time format varies between OS, so YMMV. I just discovered the first link using the substring ability "~" in environment vars. XP doesn't put the leading "0" on hours in %time%, so I used time /t here. Cut and paste the single long line and you should be fine. Note, the %time% variable changes as you might expect, so you need to set a var if you need consistency throughout the batch file.
Also note the last 2 links regarding a port of the Unix DATE.EXE might make this much simpler, though not built into the O/S.
rem echo %date% %time%
rem date /t
rem time /t
for /f "usebackq tokens=1,2,3* delims=/:. " %%a in (`time /t`) do set now=%date:~-4,4%%date:~4,2%%date:~7,2%-%%a%%b%time:~-5,2%%time:~-2,2%
echo %now%
There's also this version, that works on Windows 2012, relying solely on %date% and %time%:
set now=%date:~-4,4%%date:~4,2%%date:~7,2%-%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%
echo %now%
Tuesday, April 17, 2012
Implementing Time Protocol on Windows
http://www.unixwiz.net/tools/rfc868time.html
Not NTP, but an older Time Protocol on port 37. The above link is for a tiny service that implements Time Protocol.
Not NTP, but an older Time Protocol on port 37. The above link is for a tiny service that implements Time Protocol.
Subscribe to:
Posts (Atom)