Tuesday, February 23, 2016
W32tm WINDOWS TIME SERVICE USEFUL COMMANDS
W32tm is powerful command line tool for setup, monitoring and manage time service on Windows systems.
You can find relevant reference on TechNet website
Here some useful commands.
Note: You may need to launch an elevated Command Prompt (right-click Run as administrator)
#1 TIME OFFSET BETWEEN CURRENT COMPUTER TO YOUR DOAMIN
C:\> w32tm /monitor /domain:DOMAIN /nowarn
C:\> w32tm /stripchart /computer: DOMAIN /samples:5 /dataonly
#2 DISPLAY THE CURRENT TIME ZONE SETTINGS
C:\> w32tm /tz
#3 LIST PEERS (EXTERNAL NTP SERVERS)
C:\>w32tm /query /peers
#4 RESTORE WINDOWS TIME SERVICE ON LOCAL COMPUTER TO DEFAULT SETTINGS
Unregister service and remove all configuration information from the registry.
C:\>net stop w32time
Tuesday, March 24, 2015
SCRIPT: Service Checker and Start
Use this script to auto-start Win-Service, if service is down.
As a System administrator, you're probably know the issue with Windows Services that need to be in RUNNING mode. and service are STOPPED unexpected.
Here a little Script (write in batch), that query service status:
if service status is RUNNING, the script waiting for 5 min.
if service status IS NOT RUNNING, the script start the service.
Setting your Script
You can set service name in line 9 - Set SVC
you can specifies the number of seconds to wait in line 12 - Set WAIT
CODE: (save as *.cmd)
REM SCRIPT BEGIN
Tuesday, November 18, 2014
How to wait in a batch script ?
how waiting/sleeping for couple seconds ?
Many sysadmin daily using scripting, some time we need to delay/sleep/wait before next command.
The easy way to wait is using TIMEOUT command:
The next video show you how :
Monday, October 13, 2014
How to explorer UNC folders from command line.
If you try to explorer UNC from cmd, you will get error :
"CMD does not support UNC paths as current directories."
so, how can I explorer ??
Simple, using PUSHD command.
c:\>pushd "\\SERVER\Shares\Information Technology"
PUSHD will create a temporary drive letter that points to that specified network resource and then change the current drive and directory, using the newly defined drive letter.
Temporary drive letters are allocated from Z: on down, using the first unused drive letter found.
How to delete temporary drive letter ?
simple - run popd.exe command.
POPD Will delete any temporary drive letter created by PUSHD.
Tuesday, September 9, 2014
IT Super Menu By Haim Cohen 2014
IT Super Menu is old version of Helpdesk Tool.
i add some features , fix some bugs, and other changes.
> add new command: List Installed Windows Updates.
> add new command: List Drivers.
> Set Temp directory for reporting, C:\ITSuperMenu_Temp.
> set unknowerror msg.
> change location, from %tmp% to C:\ITSuperMenu_Temp (runas issue).
> Modify ASCII Text.
> Set %TOOLS%.
> add new option: Ping IP range.
> add new command: tracert.
> Rename this tool, now called: `IT Super Menu`
> Modify ASCII Text.
> Set one location to all ASCII files.
> New Feature - Now when you open Helpdesk...
Wednesday, August 13, 2014
Update: IT Super Menu v3.7 available here
Help Desk Tool v3.3 By Haim Cohen 2014
Helpdesk Tool By Haim Cohen 2014
So, I found my self with large folder and many Scripts.
And now, i want to share with Helpdesk team, but in central menu.
after few hours, i wrote a cmd script with many tools,
#This Script is free to use#
Please don't remove author, and give me your feedback.
You can download Full Script from here
1. Port Query
3. VNC Viewer
Wednesday, July 16, 2014
What is the best way to fix NTFS file permissions to inherit parent?
The best way to fix NTFS file permissions to inherit parent is to use Icacls utility
icacls "c:\RootDirectory\*" /q /c /t /reset
/q = Suppresses success messages.
/c = Continues the operation despite any file errors. Error messages will still be displayed.
/t = Performs the operation on all specified files in the current directory and its subdirectories.
/reset = Replaces ACLs with default inherited ACLs for all matching files.
The symbolic link cannot be followed because its type is disabled.
Enable Symbolic link Remote Server to Remote Server
If you have Remote to remote symbolic links, and you got the follow error:
"The symbolic link cannot be followed because its type is disabled"
by default remote to remote symbolic links are disabled,
Query Symbolic link Status
C:\>fsutil behavior query SymlinkEvaluation
Enable Remote to Remote Symbolic link using FSutil
C:\>fsutil behavior set SymlinkEvaluation R2R:1
Verify Symbolic links are enable by query again.
Enable Remote to Remote Symbolic link via Group Policy
You can set Symbolic link via GPO,
Go to :
Tuesday, July 15, 2014
The fast way to delete folder via CMD
simple, use rmdir.exe command:
c:\>rd "Folder to delete" /s /q
/s: included sub folders - all a tree
/q: quiet mode
Monday, January 6, 2014
How to set Environment Variable from CMD ?
If you need to change environment variable via command line, this post show you how is simple.
Let`s say you need to change environment variable "SAPLOGON_INI_FILE" from c:\windows\SAPLogon.ini to c:\sap\SAPLogon.ini.
Setx, Creates or modifies environment variables.
You can make any change in the user or system environment.
You can read more about Setx command here.
Open CMD and run this command:
c:\>setx SAPLOGON_INI_FILE c:\sap\SAPLogon.ini
That's it !
- Skepper -