حل مشکلات شبکه - کامپیوتر -سرور - مشکلاتی که روبه رو شدم

۳ مطلب در دی ۱۳۹۵ ثبت شده است

کدنویسی با DOS

echo off
color 0a
cls
echo hello i am a robot 
echo i can calculate for you
echo enter your name please
set /p name=
cls
echo welcome %name%
pause
:m
echo press 1 for Addition
echo press 2 for Subtraction
echo press 3 for Multiplication
echo press 4 for Division
echo press 5 for clearing the table
echo press 6 for exit
set /p type=
if %type%==1 goto a
if %type%==2 goto b
if %type%==3 goto c
if %type%==4 goto d
if %type%==5 goto e
if %type%==6 goto f
:a
echo Addition
echo choose the first number please
set /p n1=
echo now choose the second number
set /p n2=
echo ................................................................................
echo.     
echo  %n1%+%n2% 
echo.                                             
echo ................................................................................
echo press enter for geting the answer
pause
set /a an=n1+n2
echo ................................................................................
echo.
echo  %n1%+%n2%=%an%                                      
echo.
echo ................................................................................
echo press 1 for doing it again
echo press m for going to menu
set /p type=
if %type%==1 goto a
if %type%==m goto m
:b
echo Subtraction
echo choose the first number please
set /p n1=
echo now choose the second number
set /p n2=
echo ................................................................................
echo.
echo  %n1%-%n2%                                          
echo.
echo ................................................................................
echo press enter for geting the answer
pause
set /a an=n1-n2
echo ................................................................................
echo.
echo  %n1%-%n2%=%an%                                     
echo.
echo ................................................................................
echo press 2 for doing it again
echo press m for going to menu
set /p type=
if %type%==2 goto b
if %type%==m goto m
:c
echo Multiplication
echo choose the first number please
set /p n1=
echo now choose the second number
set /p n2=
echo ...............................................................................
echo.
echo  %n1%*%n2%                                        
echo.
echo ...............................................................................
echo press enter for geting the answer
pause
set /a an=n1*n2
echo ...............................................................................
echo.
echo  %n1%*%n2%=%an%                                   
echo.
echo ...............................................................................
echo press 3 for doing it again
echo press m for going to menu
set /p type=
if %type%==3 goto c
if %type%==m goto m
:d
echo Division
echo choose the first number please
set /p n1=
echo now choose the second number
set /p n2=
echo ...............................................................................
echo.
echo  %n1%/%n2%                                      
echo.
echo ...............................................................................
echo press enter for geting the answer
pause
set /a an=n1/n2
echo ...............................................................................
echo.
echo  %n1%/%n2%=%an%                                 
echo.
echo ...............................................................................
echo press 4 for doing it again
echo press m for going to menu
set /p type=
if %type%==4 goto d
if %type%==m goto m
:e
echo Clearing cmd
echo press enter for clearing cmd
pause
cls
echo press m please
set /p type=
if %type%==m goto m
:f
cls
echo                                       Exit
echo.
echo.
echo                              ......................
echo                              .thanks for using me .
echo                              .  wish you luck     .
echo                              ......................
pause
exit

 

۰ نظر موافقین ۰ مخالفین ۰
رضا اسماعیلی

خطاهای هنگام نصب ویندوز

Windows Cannot Be Installed to a Disk? Here Are Solutions

  • Contents:

    37

    When installing Windows OS (whether it is clean install, reinstall or dual boot), you may receive various kinds of errors saying Windows cannot be installed to this disk. In this post, we will introduce 6 types of Windows installation errors as well as top corresponding solutions. 
     

    Error 1: Windows Cannot Be Installed to This Disk. The Selected Disk Is of the GPT Partition Style.


    When installing Windows on a GPT disk, you may receive Windows cannot be installed on GPT disk error: 

    "Windows cannot be installed to this disk. The selected disk is of the GPT partition style." 

    What caused this error? 
     

    Reasons


    This is mainly because the motherboard supports Legacy BIOS only rather than both Legacy and UEFI or CSM boot. Under legacy BIOS mode, you can only install Windows to a MBR disk since traditional BIOS cannot recognize GPT partition, but data read/write on GPT disk is available as long as Windows supports it. 
     

    Solutions


    To fix this error, firstly you need to enter BIOS Setup to see what the boot mode it is set to. Start/restart computer and continuously press a key to enter BIOS before Windows logo appears. Different computers may require different keys, so you had better search "how to enter BIOS plus computer trademark or motherboard name" on the internet to find the exact key. 

    In BIOS, if you find no signal showing you are using UEFI motherboard like the following picture shows, maybe you are using a traditional motherboard which supports legacy BIOS boot only. Under this situation, the only solution is to convert GPT disk to MBR disk. 

    bios mother board 

    Here are the deals:. 
     

    1. Convert GPT Disk to MBR If the Motherboard Supports Legacy BIOS Only

     

    NOTE:We will explain 3 ways to convert GPT disk to MBR disk. The 2nd & 3rd ways will cause data loss since Windows requires to delete all partitions.

     
    • Use Partition Wizard

    • MiniTool Partition Wizard Free Edition is a free yet outstanding partitioning tool for Windows NON-SERVER users, which helps to convert GPT disk to MBR disk without losing data when an existing Windows is available. However, you should know that Partition Wizard can only change non-system GPT disk to MBR disk without bringing any data loss. 
       

       

      For Windows XP/Vista/7/8/10 users

      If no Windows can be used, you may need the help of MiniTool Partition Wizard Bootable CD, a free bootable partitioning tool. 

      Step 1: Launch MiniTool Partition Wizard. Then right-click on the target disk to be converted and choose "Convert GPT Disk to MBR Disk". 

      convert gpt to mbr 

      Step 2: You will see the GPT attribute is turn to MBR. However, this is only pending operations for us to preview. Please press "Apply" to confirm the change. After the conversion, you will find that all data are still there. 

      apply conversion 



    •  
    • Use Diskpart

    • It is possible to make the conversion during the installation process. Please do the followings: 

      Step 1: Once the error pops up, click "OK" to close the error and try pressing on "Shift + F10" to call out CMD. If the utility does not emerge, please go back to the install Windows interface: 

      reinstall windows 

      Step 2: Then press "Shift + F10" again to launch CMD. Next clean the disk by typing the following commands: 
      "diskpart -> list disk -> select disk 1 (1 signifies the number of GPT disk) -> clean -> convert MBR.

      diskpart convert mbr 

      Step 3: When diskpart shows it has successfully converted the selected disk to MBR format, you can exit from this program and continue to install Windows. 



    •  
    • Use Disk Management Utility

    If another Windows OS is available on the same computer, then Disk Management utility is helpful. Try these operations: 

    Step 1: Start the working Windows and enter the built-in Disk Management tool by right clicking "Computer" icon on desktop, choosing "Manage", and selecting "Disk Management": 

    Step 2: Delete all partitions or volumes on the GPT disk one by one via the right-click function "Delete Volume". 

    delete volume 

    Step 3: When the entire disk becomes an unallocated space, right click the GPT disk and choose "Convert to MBR Disk". After these steps, the original GPT disk will be converted to MBR disk, and then you can go on installing Windows on this disk. 

    convert to mbr disk 
     

    TIP:when deleting volumes you may meet the situation where some special volumes like system volume, recovery volume, and OEM volume cannot be deleted. For reasons and corresponding solutions, please see Cannot Delete Volumes in Windows.

     

    2. Change Boot Mode If the Motherboard Supports Both Legacy and UEFI Boot


    Currently, most motherboards support both Legacy boot and UEFI boot, and users can choose the most appropriate one manually. If you select Legacy only, it will be impossible to install Windows on GPT disk. At this time, you can enter BIOS and set the boot mode to CSM boot or choose Both

    boot mode csm 
    boot mode both 

    Once the change has been made, please press on F10 to save changes, and then you can install Windows on a GPT disk. 
     

    Error 2: Windows Cannot Be Installed to This disk. The Selected Disk Has an MBR Partition Table.


    When installing Windows 7, Windows 8 or other newly released Windows OS, you may receive another error saying Windows cannot be installed on MBR disk: 

    "Windows cannot be installed on this disk. The selected disk has an MBR partition table. On EFI systems, Windows can only installed on GPT disks". 

    Why Windows cannot be installed on MBR disk under EFI systems? 
     

    Reasons


    To answer this question, you need to know something about UEFI + GPT boot. Under EFI systems, theoretically both MBR disk and GPT disk can be used to boot operating systems, but Microsoft rules Windows can only be installed on GPT disk. To fix this error, the best way is to convert the MBR disk to GPT disk. 
     

    Solutions

     

    1. Convert MBR Disk to GPT Disk to Fix the Error


    Steps are nearly the same as those to convert GPT disk to MBR disk, and the only difference is that you need to convert disk to GPT rather than MBR. For converting without data loss, please see Convert MBR Disk to GPT Disk for more details. 

    That's not all…In the former part, we have said most UEFI motherboards support both Legacy boot and UEFI boot but we can change it manually. If the error is caused by setting boot mode to be UEFI only, changing the mode to Both or CSM boot may fix the error, which has been introduced in Error 1. 

    Tweet Your New Skill
     
     

    Error 3: Windows Cannot Be Installed on Dynamic Disk.


    When installing Windows on a dynamic disk, you may receive this message: 

    "Windows cannot be installed to this hard disk space. The partition contains one or more dynamic volumes that are not supported for installation". 
     

    Reasons


    Why Windows cannot be installed on dynamic disk? Let’s see how Microsoft says. 
     

    "You can perform a fresh Windows installation on a dynamic volume only if that volume was converted from a basic volume and retained an entry in the partition table. Simple volumes converted from basic disks do not have an entry in the partition table unless they were system or boot volumes prior to conversion." 
    --from Microsoft Resource

     

    That is to say users can only install Windows to dynamic volume which was a boot partition or system partition before converting to dynamic disk. Under this situation, if you want to go on installing Windows, a good solution is to convert dynamic disk to basic disk. 
     

    Solutions

     

    1. Convert Dynamic Disk to Basic Disk to Solve the Problem

     

    NOTE:There are 3 ways to convert dynamic disk to basic: by using MiniTool Partition Wizard, Disk Management utility, and diskpart. Note that the latter 2 require deleting all existing dynamic volumes, which means data loss.

     
    • Use MiniTool Partition Wizard

    • MiniTool Partition Wizard is a Windows based partitioning tool that can help revert a dynamic disk to basic without any data loss. 

      Here are detailed steps: 

      Step 1: Launch MiniTool Partition Wizard. Right click on the dynamic disk you want to convert and choose "Convert Dynamic Disk to Basic Disk". 

      convert dynamic to basic 

      Step 2: You can have a preview that this dynamic disk will become basic disk without data loss. At this time press "Apply" to finish this conversion. 

      confirm conversion 
       
      NOTE:The free edition does not support operating dynamic disk, so please purchase professional or more advanced editions for dynamic disk support. 

      In addition, if Windows cannot boot normally, Partition Wizard Pro built-in tool - MiniTool Partition Wizard Bootable CD is available for it can boot computer without Windows OS. 
       

       


    • Use Disk Management Utility

    • Go to Disk Management and then delete all volumes one by one, which has been introduced in Error 1. After these steps, the dynamic disk will become basic automatically. 

      However, if there is no Windows OS available but you have a Windows installation CD or DVD, make use of Diskpart. 



    •  
    • Employ Diskpart

    Step 1: Boot computer via the installation disc and open CMD by pressing on "Shift + F10". 

    Step 2: Type corresponding commands to delete all dynamic volumes one by one:
    "diskpart -> list disk -> select disk N (N is the number of the dynamic disk) -> detail disk -> select volume=0 -> delete volume -> select volume=1 -> delete volume…

    Step 3: After all volumes on the dynamic disk are deleted, type "convert basic". Once Diskpart shows it has successfully converted the selected dynamic disk to basic, you can type "exit" to quit from Diskpart. 

    convert basic 

    Nevertheless, if you do not want to delete any volume since important data are saved, there is a lossless solution below. 

    Tweet Your New Skill
     
     

    Error 4: Windows Cannot Be Installed to This Disk. This Computer's Hardware May not Support Booting to This Disk.


    Another error message you may receive during Windows installation is: 

    "Windows cannot be installed to this disk. This computer's hardware may not support booting to this disk. Ensure the disk's controller is enabled in the computer's BIOS menu." 
     

    Reasons


    Generally speaking, there are 2 possible reasons: 
     
    • Hard disk protection is enabled.
    • SATA Controller mode was set incorrectly (with incorrect drive mode, the very disk cannot be used normally).
     

    Solutions

     

    1. Remove Hard Disk Protection


    For the first situation, please read the specification or contact sales person to confirm whether there is hard disk protection if the computer is not configured by ourselves. If there is, remove the protection by following instructions. 
     

    2. Change SATA Controller Mode


    For the second situation, if we changed SATA Controller mode in BIOS before, try setting BIOS to factory settings. Different BIOS gives different options to set itself to factory settings, like Restore DefaultsLoad BIOS Defaults, and Load Optimal Defaults, so you should choose the correct one according to practical situations. 

    However, when this solution does not work, you must change hard disk mode manually in BIOS. If the current state is IDE, change it to AHCI. If the current mode is AHCI, change it to IDE, etc. Actually, if Compatibility or Compatible is given, you must choose this mode. 

    change sata controller mode 

    Moreover, when you are installing Data Center or Enterprise Server edition of Windows Server 2008/R2 or later to a raw disk via CD or DVD, you may get the same error. This is because the default SAN policy during setup on new installations of Data Center or Enterprise SKUs is Offline Shared, which applies Offline and Read Only attributes to any presented disks that are on a shared bus and not considered as System or Boot disks. RAW disks cannot be detected as System or Boot, leading to offline and read only attributes. As a result, you cannot install Windows to this kind of disks. To solve the problem, configure the default SAN policy to OnlineAll. For detailed steps, please see the corresponding Setup Reports Error of Microsoft. 
     

    Error 5: Windows Cannot Be Installed to This Disk. The Disk May Fail Soon.


    Sometime you may receive the following error message when installing Windows: 

    "Windows cannot be installed to this disk. The disk may fail soon. If other hard disks are available, install Windows to another location." 
     

    Reasons


    When this error appears, it indicates there may be something wrong with the hard disk. 
     

    Solutions

     

    1. Backup and Repair/Replace the Hard drive


    At this time, you must stop Windows installation, and then backup important data immediately in case of real disk failure. If there are not so many data that is required to backup, just copy and paste them to a safe place. However, if you want to backup all or a large number of data on the disk, using a third party disk clone softwareto back up the entire hard disk can save you a lot of time. 
     

    TIP:If there is no Windows to use, you may need a bootable disk clone tool, and free MiniTool Partition Wizard Bootable CD might be a good choice.


    When the backup is made, check the health state of the disk by running diagnosis and repair tools which can be downloaded either from the hard disk manufacturer’s website or from professional downloading center. If Windows won’t boot, please download the ISO file and burn it to CD or DVD on another computer, and then make a disk diagnosis via the bootable disc. 

    If errors are detected from your hard disk but cannot be repaired, replace the dying hard disk with a new one. However, if it is under warranty, send it back to manufacturers because they will repair the disk or give you a new one. 
     

    Error 6: Windows Cannot Be Installed to This Hard Disk Space, Windows Must Be Installed to a Partition Formatted in NTFS.


    When installing Windows on old disk, you may receive Windows cannot be installed to this hard disk space error: 

    "Windows cannot be installed to the hard disk space. Windows must be installed to a partition formatted in NTFS." 
    What caused this error? 
     

    Reasons


    This is mainly caused by incompatible file system of the partition to be installed with Windows. Microsoft rules that Windows must be installed to a partition formatted in NTFS since Windows Vista. 
     

    Solutions

     

    1. Format the Partition with NTFS File System


    Use MiniTool Partition Wizard 

    Remember Windows won't allow you to format the current boot partition no matter you turn to Disk Management or CMD. But if you try to format non-system partition, they are helpful. Thus, to make things easier, we strongly recommend using MiniTool Partition Wizard Bootable Edition to cope with different situations with one solution. Please do the followings: 

    Step 1: Download MiniTool Partition Wizard bootable CD, burn the iso image to USB flash drive or CD/DVD, set computer to boot from the bootable media and enter into MiniTool Partition Wizard. 
     

     

    For Windows XP/Vista/7/8/10 users

    Step 2: Click on the partition to be formatted and select "Format Partition" from the operations menu. 

    Windows cannot be installed to this disk 14 

    Step 3: In the pop-up window, choose NTFS at file system and then click "OK" to continue. 

    Windows cannot be installed to this disk 15 

    Step 4: Back to the main interface and hit "Apply" to execute this change. 

    Use Windows Installation Disk 

    Also you can choose to format the partition during the installation. When you see "where do you want to install Windows", click on the target partition at first and then hit Drive Options (Advanced) to format it. 
     

    2. Clean the Whole Drive


    Another solution for Windows should be installed to a partition formatted in NTFS is to clean the whole drive. You can also use MiniTool Partition Wizard Bootable CD to do this job (use Delete All Partitions), then Windows will make its partition automatically during installation. 

    Tweet Your New Skill
     


 

 

۱ نظر موافقین ۰ مخالفین ۰
رضا اسماعیلی

اگر سرور دامین خاموش باشد کاربران اصولا باید با همان یوزر و پسورد تعریف شده در دامین میتوانند لاگین بشند؟

سوال اول اینکه اگر سرور دامین خاموش باشد کاربران اصولا باید با همان یوزر و پسورد تعریف شده در دامین میتوانند لاگین بشند؟ 

بله میشه یک پالیسی وجود داره که شما می تونید تعریف کنید اگر سرور خاموش و یا در دسترس نبود کاربران چند بار این توانایی رو داشته باشند که به دامین لاگین کنند.تو این فرایند نام کاربری و پسورد دامین اصطلحا کش میشه.می تونید بوسیله ی کنسول group policy این فرایند را انجام بدید 
اگر قصد داشته باشید این رو غیر فعال کنید باید وارد مسیر زیر بشید 
 

Computer Configuration-Policies-windows settings-security-Local Policies-Security Options 
بعد باید دنبال گزینه ی Interactive Logon:Number Of Previous Logons to cache بگردید برای غیر فعال کردن باید مقدارش را 0 بزنید.بعد از آن یک بار دستور gpupdate /force بزنید بر روس سرور و یک بار هم بر روی کلاینت ها این دستور را بزنید. 

 

۰ نظر موافقین ۰ مخالفین ۰
رضا اسماعیلی