Unable to delete old hard drive’s partition in Disk Management

Issue: I wanted to use faulty laptop’s old hard drive as external drive but i when i trying to delete all partition, i were only able to delete drive C, other partitions like Recovery, System and Reserved etc doesn’t have the option to delete.

Solution:
Using DISKPART command in command prompt
1) Run command prompt as administrator

2) Type diskpart

3) Type list disk
4) Type select disk 1 (disk 1 is the old hard drive)
5) Type list partition ( it displays partitions have not deleted)
diskpart01

6) Type select partition=1 (select the first Recovery partition to delete)
7) Type delete partition override (delete partition)
8) repeat step 6 and 7 to delete rest of the partitions
diskpart02

9) Type exit (to exit DISKPART)
10) Go to Disk Management, old hard drive’s partitions have been deleted.
diskpart03

Advertisements

Shutdown computer using batch file & Task Scheduler

Issue: User refused to shutdown computer at the end of the day

Solution:
1) Create a shutdown batch file
shutdown.bat:
  @echo off
     cd\
     cls
     c:
     shutdown /t 30 /s

2) Create a Task in Task Scheduler
General: Run whether user is logged  on or not
Run with highest privileges
Trigger: daily at 5pm
Action: Start a program
Program/Script: C:\temp\shutdown.bat
Conditions: Wake the computer to run this task

Reference:
https://technet.microsoft.com/en-us/library/bb491003.aspx

shutdown

Empty Recycle Bin using Command Prompt (Win 7)

Issue: There are files and folders refused to be delete from Recycle Bin. It will give me “Access Denied” prompt.

Solution:
1) Run command prompt
2) Type rd /s /q %systemdrive%\$Recycle.bin or rd /s/q C:\\$Recycle.bin

Reference:
http://stackoverflow.com/questions/9238953/how-to-empty-recyclebin-through-command-prompt

For Windows XP, uses rd /q /s C:\Recycler 

Restart SAPB1 services daily

Issue: Our SAP B1 often has login issue; users will be prompted for Server’s IP when they run the program. It means that SAP B1’s one of the services is not running properly.
Suggestion from our vendor’s SAP Consultant is to restart TAO NT Naming Service (restart this service, other services – SAP Business One BackUp Service and SAP Business One License Manager will also restart).
No permanent solution from our vendor The World Management Pte Ltd.
Hope they don’t sue me.

Workaround solution:
Created a batch file that schedule to run before office starts work.

Restart_SAPB1_Svr.bat
REM_Stop Services_
sc stop SBOMail
sc stop TAO_NT_Naming_service
timeout /t 10
REM_Start Services_
sc start SBOMail
sc start TAO_NT_Naming_Service
REM_Output results to a text file
del c:\temp\run.txt /F
sc query SBOMail > C:\temp\run.txt
sc query TAO_NT_Naming_Service >>C:\temp\run.txt

Beside login issue, I also facing Purchasing users unable to send fax or email from SAP B1, therefore I need to restart SBOMail service.

Last two lines are to output results to a text file, for fun only.

Find out computer name using Ping command

C:\>ping -a 192.168.3.101

Pinging Exchange-PC [192.168.3.101] with 32 bytes of data:
Reply from 192.168.3.101: bytes=32 time=2ms TTL=128
Reply from 192.168.3.101: bytes=32 time<1ms TTL=128
Reply from 192.168.3.101: bytes=32 time<1ms TTL=128
Reply from 192.168.3.101: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.3.101:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 2ms, Average = 0ms

Who is browsing facebook? Uses nbtstat…

I have users always wanted to open facebook even though they knew facebook website is blocked by firewall.

Checked on firewall’s log and noticed that someone is trying his luck.
firewall_logs

So i run nbtstat – a <IP Address> in command prompt.

nbtstat

I was able to know the 192,.168.1.14’s owner, that is computer name, workgroup name and MAC Address.