Windows creates a Pagefile.sys file in "C" drive's root directory, and it is used to swap data between the hard drive and the faster random access memory, or RAM. By default, this file can be up to three times the amount of RAM you currently have installed. Being as the paging file is primarily used when you run out of RAM, which can happen when you run several powerful business applications at the same time, the amount allocated for the pagefile.sys can be too large for practical use. This isn't a big deal when you have ample free space on your hard drive, but if you're running short on storage space for your business files, you might want to reduce pagefile.sys.
Step 1
Click "Start," right-click "Computer" and select "Properties."
Step 2
Click "Advanced System Settings," select the "Advanced" tab and choose "Settings" in the Performance section.
Step 3
Click the "Advanced" tab and select "Change" in the Virtual Memory section.
Step 4
Deselect "Automatically Manage Paging File Size for all Drives."
Step 5
Click "Custom Size" and enter a smaller value in the "Initial Size (MB)" and "Maximum Size (MB)" fields. Alternately, click "No Paging File" if you want to remove pagefile.sys entirely. This is only recommended if you have a lot of RAM.
Step 6
Click "Set." Click "Yes" if you receive a confirmation or warning window.
Step 7
Click "OK" to each of the windows to exit them.
Step 8
Restart your computer for the settings to become active.
Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts
Sunday, 1 February 2015
Windows Admin - How to config SYS file
While Windows has moved away from using Microsoft Disk Operating System as a base, versions of DOS still persist. Some programs refuse to run in modern versions of Windows and require a DOS emulator. If your business runs programs in DOS, understanding how to configure the Config.sys file to load your devices, such as a CD-ROM, is necessary. Configurations vary, so check which version of DOS your company is using.
Step 1
Press "Windows-R" to open the Run menu. Type "cmd" (without quotes here and in subsequent commands) and press "Enter" for a command prompt.
Step 2
Type "cd\" and press "Enter." Type "edit config.sys" in the command window to open an editor for the Config.sys file.
Step 3
Type in the configuration options for your Config.sys file. The most common Config.sys commands are the following: DEVICE=C:\WINDOWS\HIMEM.SYS DOS=HIGH,UMB DEVICE=C:\WINDOWS\EMM386.EXE noems
The Himem.sys file is a high memory manager, into which the next command "DOS=HIGH,UMB" loads DOS. "EMM386" is the extended-memory support and is generally disabled with the "noems" command.
Step 4
Add any devices you need to load to Config.sys with the "DEVICEHIGH" command, such as "DEVICEHIGH=C:\ATAPI\CDROM.sys" for a CD-ROM drive.
Step 5
Type "LASTDRIVE=S," where "S" is the last drive letter you want available to DOS.
Step 6
Add the following lines to your Config.sys file to add a menu to your Config.sys and boot loading: [MENU] MENUITEM STARTUP, Basic Startup MENUITEM NETWORK, Network Start
This displays a menu on startup with the items Startup and Network. Farther down in the file, type "[STARTUP]" along with any commands to run under that item, such as the basic configuration in the previous example, which enables you to specify commands for the various Config.sys configurations based on your needs. See Resources for more Config.sys options.
Step 7
Press "Alt-F" then "S" to save the file, or click on the "File" menu and choose "Save."
Step 8
Press "Alt-F" then "X" to exit, or choose "Exit" from the menu.
Step 1
Press "Windows-R" to open the Run menu. Type "cmd" (without quotes here and in subsequent commands) and press "Enter" for a command prompt.
Step 2
Type "cd\" and press "Enter." Type "edit config.sys" in the command window to open an editor for the Config.sys file.
Step 3
Type in the configuration options for your Config.sys file. The most common Config.sys commands are the following: DEVICE=C:\WINDOWS\HIMEM.SYS DOS=HIGH,UMB DEVICE=C:\WINDOWS\EMM386.EXE noems
The Himem.sys file is a high memory manager, into which the next command "DOS=HIGH,UMB" loads DOS. "EMM386" is the extended-memory support and is generally disabled with the "noems" command.
Step 4
Add any devices you need to load to Config.sys with the "DEVICEHIGH" command, such as "DEVICEHIGH=C:\ATAPI\CDROM.sys" for a CD-ROM drive.
Step 5
Type "LASTDRIVE=S," where "S" is the last drive letter you want available to DOS.
Step 6
Add the following lines to your Config.sys file to add a menu to your Config.sys and boot loading: [MENU] MENUITEM STARTUP, Basic Startup MENUITEM NETWORK, Network Start
This displays a menu on startup with the items Startup and Network. Farther down in the file, type "[STARTUP]" along with any commands to run under that item, such as the basic configuration in the previous example, which enables you to specify commands for the various Config.sys configurations based on your needs. See Resources for more Config.sys options.
Step 7
Press "Alt-F" then "S" to save the file, or click on the "File" menu and choose "Save."
Step 8
Press "Alt-F" then "X" to exit, or choose "Exit" from the menu.
Windows Cmd - Useful Ones
1. List Dir structure in Tree style
tree /A "C:\TIBCOProjects" > C:\TIBCOProjects\DirTree.txt
2. Flush DNS changes in the network
ipconfig /flushdns
3. Net Stat find info and kill process
Ex.: Find process running on a specific port 8080
netstat -ano | find "8080"
or
netstat -ano | findstr 8080
----------------Sample--------------------
netstat -ano | find "4001"
sample outcome:
TCP 0.0.0.0:4001 0.0.0.0:0 LISTENING 1536
TCP 10.20.2.220:4001 10.20.10.108:1654 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1696 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1737 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1783 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1829 TIME_WAIT 0
----------------------------------------------
Kill the process running on the specific process id:
taskkill /F /PID <pid>
4. Sort then Unique the file recs:
Write the bat file with following content:
@echo off
goto :TopOfCode
=======================================================================
Author:
Warren Chen
Date: 2014.10.20
Useage:
SortAndUniqueFile.bat [SourceFile] [> OutputFile]
e.g.
SortAndUniqueFile.bat "c:\test case\input.txt" > "c:\test case\output.txt"
=======================================================================
:TopOfCode
setlocal disabledelayedexpansion
set "prev="
for /f "delims=" %%F in ('sort %1' ) do (
set "curr=%%F"
setlocal enabledelayedexpansion
if !prev! neq !curr! echo !curr!
endlocal
set "prev=%%F"
)
5. Move file from share location to local in Batch
Write bat file with following content:
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
rem ========== Configuration area ==========
set sourceDir=\\ulttib01\admin\test
set targetDir=C:\test\MoveFile\output
set fileType=*.xml
set batchSize=10
set fileCount=0
set sleepSec=1
set netDrive=s:
set leftFileCount=0
rem ========== Configuration area ==========
net use %netDrive% %sourceDir%
goto MoveFile
:MoveFile
for %%a in ("%netDrive%\%fileType%") do (
set /a fileCount+=1
rem echo the file is: %%a
if !fileCount! leq %batchSize% move "%%a" %targetDir%
)
set /a fileCount=0
:CountFile
set leftFileCount=0
for %%f in ("%netDrive%\%fileType%") do (
set /a leftFileCount+=1
)
echo File left: %leftFileCount%
goto CheckPoint
:CheckPoint
if !leftFileCount! gtr 1 (
echo sleep
ping 1.1.1.1 -n 1 -w 3000 > nul
echo finished sleep
goto MoveFile
) ELSE (
goto End
)
:CountFile1
FORFILES /S /M %netDrive%\*.xml /C "set /a fileCount+=1"
echo The file number is now: %fileCount%
:End
net use /del s:
ENDLOCAL
tree /A "C:\TIBCOProjects" > C:\TIBCOProjects\DirTree.txt
2. Flush DNS changes in the network
ipconfig /flushdns
3. Net Stat find info and kill process
Ex.: Find process running on a specific port 8080
netstat -ano | find "8080"
or
netstat -ano | findstr 8080
----------------Sample--------------------
netstat -ano | find "4001"
sample outcome:
TCP 0.0.0.0:4001 0.0.0.0:0 LISTENING 1536
TCP 10.20.2.220:4001 10.20.10.108:1654 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1696 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1737 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1783 TIME_WAIT 0
TCP 10.20.2.220:4001 10.20.10.108:1829 TIME_WAIT 0
----------------------------------------------
Kill the process running on the specific process id:
taskkill /F /PID <pid>
4. Sort then Unique the file recs:
Write the bat file with following content:
@echo off
goto :TopOfCode
=======================================================================
Author:
Warren Chen
Date: 2014.10.20
Useage:
SortAndUniqueFile.bat [SourceFile] [> OutputFile]
e.g.
SortAndUniqueFile.bat "c:\test case\input.txt" > "c:\test case\output.txt"
=======================================================================
:TopOfCode
setlocal disabledelayedexpansion
set "prev="
for /f "delims=" %%F in ('sort %1' ) do (
set "curr=%%F"
setlocal enabledelayedexpansion
if !prev! neq !curr! echo !curr!
endlocal
set "prev=%%F"
)
5. Move file from share location to local in Batch
Write bat file with following content:
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
rem ========== Configuration area ==========
set sourceDir=\\ulttib01\admin\test
set targetDir=C:\test\MoveFile\output
set fileType=*.xml
set batchSize=10
set fileCount=0
set sleepSec=1
set netDrive=s:
set leftFileCount=0
rem ========== Configuration area ==========
net use %netDrive% %sourceDir%
goto MoveFile
:MoveFile
for %%a in ("%netDrive%\%fileType%") do (
set /a fileCount+=1
rem echo the file is: %%a
if !fileCount! leq %batchSize% move "%%a" %targetDir%
)
set /a fileCount=0
:CountFile
set leftFileCount=0
for %%f in ("%netDrive%\%fileType%") do (
set /a leftFileCount+=1
)
echo File left: %leftFileCount%
goto CheckPoint
:CheckPoint
if !leftFileCount! gtr 1 (
echo sleep
ping 1.1.1.1 -n 1 -w 3000 > nul
echo finished sleep
goto MoveFile
) ELSE (
goto End
)
:CountFile1
FORFILES /S /M %netDrive%\*.xml /C "set /a fileCount+=1"
echo The file number is now: %fileCount%
:End
net use /del s:
ENDLOCAL
Subscribe to:
Posts (Atom)