2016年8月10日星期三

How to Fix - batch file works in WinXP but not in Win7?

batch file works in WinXP but not in Win7

I am trying to get the USB_Multiboot_10.cmd to work in Windows 7.

It works without modification on Windows XP sp3.

If some with more knowledge than me, won't take much :) I would appreciate any help.

If the full zip file is needed I can upload or you can google "USB_Multiboot_10.zip"to get download
Below is a the code that fails, my changes make it work but it doesn't make all the checks it should.
IF %win_vista% EQU 0 (
  FOR /F "tokens=*" %%a in ('fsutil fsinfo drives ^| FIND /V ""') DO (
    set dr=%%a
////////////////////////////////////////////////////////////////////////////////////////////////////////
==========THE LINE BELOW WAS " SET dr=!dr:~-3,3!" but would not work in Win7===========================
==========This way it works as long as I have the same drive names====================================
    SET dr=!dr:~56,3!
    SET cdr=!dr:~0,1!
    IF !cdr! GTR C (
///////////////////////////////////////////////////////////////////////////////////////////////////
===========THIS check below for FAT NTFS does not work ============================================
      FOR /F "tokens=1 delims= " %%G IN ('fsutil fsinfo volumeinfo !dr! ^| FINDSTR "FAT NTFS"') DO (
        SET vname=%%G
        SET vname=!vname:~0,1!
        IF !vname! NEQ V call set drlist=%%drlist%% %%dr:~0,2%%
      )
    )
  )
) ELSE (
  FOR /F "tokens=1,* delims= " %%a in ('fsutil fsinfo drives') DO set vdrlist=%%b
  FOR %%C IN (!vdrlist!) DO (
    SET dr=%%C
    SET cdr=!dr:~0,1!
    IF !cdr! GTR C (
      FOR /F "tokens=1 delims= " %%G IN ('fsutil fsinfo volumeinfo !dr! ^| FINDSTR "FAT NTFS"') DO (
        SET vname=%%G
        SET vname=!vname:~0,1!
        IF !vname! NEQ V call set drlist=%%drlist%% %%dr:~0,2%%
      )
    )
  )
)

=============the "goto _mkmulti" I added because this line was not working     "FOR /F "tokens=1 delims= " %%G IN
('fsutil fsinfo volumeinfo !dr! ^| FINDSTR "FAT NTFS"')"     It caused it to stop on the following "FOR"
command=====================================================
goto _mkmulti
FOR %%i IN (%drlist%) DO IF "%%i" == "%usbdrive%" goto _mkmulti
ECHO.
ECHO  ***** ERROR - Drive has NOT FAT FAT32 OR NTFS Format OR is C-Drive ******
ECHO.
pause
goto _main
----------------------------------------------------------------------------------------
:_ucase
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
FOR %%i IN (%drlist%) DO IF "%%i" == "!_ok!:" SET usbdrive=!_ok!:
=====THE LINE ABOVE DOESN'T WORK SO I ADDED THE LINE BELOW====================================
SET usbdrive=!_ok!:

Anwsers to the Problem batch file works in WinXP but not in Win7

Download SmartPCFixer for Free Now

Manually editing the Windows registry

Caution: Unless you an advanced PC user, please do not edit the Windows registry manually.

Because of this risk, we highly recommend using a trusted registry cleaner such as SmartPCFixer Using a registry cleaner automates the process of finding invalid registry entries, missing file references (like the one causing your MACHINE_CHECK_EXCEPTION error), and broken links within the registry. A backup is automatically created before each scan, with the ability to undo any changes in a single click, protecting you against the possibility of PC damage. The best part is that repairing registry errors can also dramatically improve system speed and performance.

  • Click the Start button.
  • Type "command" in the search box... DO NOT hit ENTER yet!
  • While holding CTRL-Shift on your keyboard, hit ENTER.
  • You will be prompted with a permission dialog box.
  • Click Yes.
  • A black box will open with a blinking cursor.
  • Type "regedit" and hit ENTER.
  • In the Registry Editor, select the Error 0x9C-related key (eg. Windows Operating System) you want to back up.
  • From the File menu, choose Export.
  • In the Save In list, select the folder where you want to save the Windows Operating System backup key.
  • In the File Name box, type a name for your backup file, such as "Windows Operating System Backup".
  • In the Export Range box, be sure that "Selected branch" is selected.
  • Click Save.
  • The file is then saved with a .reg file extension.
  • You now have a backup of your MACHINE_CHECK_EXCEPTION-related registry entry.

The next steps in manually editing your registry will not be discussed in this article due to the high risk of damaging your system. If you would like to learn more about manual registry editing, please see the links below.

Another Safe way to Fix the Problem: batch file works in WinXP but not in Win7:

How to Fix batch file works in WinXP but not in Win7 with SmartPCFixer?

1. Click the button to download SmartPCFixer . Install it on your computer.  Open it, and it will perform a scan for your computer. The junk files will be shown in the scan result.

2. After the scan is finished, you can see the errors and problems need to be repaired. Click Fix All.

3. The Repair part is finished, the speed of your computer will be much higher than before and the errors have been removed. You can also use other functions in this software. Like dll downloading, junk file cleaning and print spooler error repair.


Related: Autologon and AutoLogonCount Parameters for Windows Unattended Setup Error Fixer,How To Resolve Cyberbit Unicode Font Does Not Return Correct Charset Problem,How To Use the Office Profile Wizard to Create an OPS File in Office XP Error Fixer,Error Sys Msg 22 Invalid period, please reenter. in MC in 4.x Solution,Why am I Getting a Upgrades from 3.01 to 3.60 or 3.01 to 3.70 Involving Serial Numbers and Revaluations Are Overstating the Valuation Entries on the Purchases Error?,How Can I Fix - Error 16389?,How to Fix - Internetopen?,Mcafee Virus Scan Online,How Can I Fix - Qos Packet Scheduler Failed?,Solution to Problem: Windows 2000 Boot Repair,How to Fix ashoutxt.dll Not Found Error,Best Method to Fix cxcore096.dll Error,Where can I Find dsauth.dll File,msde.dll Corrupted - How to Resolve,psizewizres.dll Corrupted - How to Fix,How to Download ASUS XGI Compatible Super VGA Driver Package Version R1.13.00/Driver Version 6.14.10.1130 for Windows XP 32/64 bit(WHQL),Windows Server 2003 32/64 bit(WHQL),Windows Vista 32/64 bit(WHQL),Windows Server 2008 32/64 bit(WHQL),Windows 7 32/64 bit(WHQL),Window,Download NeoMagic® MagicMedia 256AVP Display Adapter Driver,Download NVIDIA RIVA TNT2 Model 64,How to Update Realtek ALC850 AC'97 Driver V5.10.0.5900 WHQL for Windows 2000/XP/2003 & 64bit XP/2003.,How to Update Realtek LAN V6.203.0214.2008,Microsoft.PowerShell.GraphicalHost.dll Error Code Fixer
,Fix Error Code Netapi32 (4).dll
,Qa_auth_client.dll Error Code Fixer
,Fix Error Code Tdc (3).ocx
,Vwipxspx.dll Error Code Fixer
,Way to Download Toshiba Qosmio X505-Q832 Intel Wireless LAN Driver v.12.4.1.11.0.s64_wCAT,Download Toshiba Satellite C650D-ST6N02 Assist Utility v.4.2.3.0 driver,How Can You Update & Download Toshiba Satellite L645-S4026RD Value Added Package v.1.6.0130.640202 driver,Method to Download Toshiba Satellite L755-S9511D Assist Utility v.4.2.3.1 driver,Method to Download Toshiba Satellite P875-S7200 Fingerprint Utility v.2.0.0001.000408 driver,Best Way to Download NVidia GeForce 6100 VGA Driver v.304.51 Certified,How Can You Update & Download NVidia GeForce 9300/nForce 730i VGA Driver v.310.19 Certified,Method to Download NVidia GeForce GT 330M Driver v.340.65,How Can I Update & Download NVidia GeForce GTX 590 Driver v.280.26 WHQL,Method to Download NVidia Tesla C2050 Driver v.319.17
Read More: Troubleshoot:Black Screen followed by extremely slow boot, but no entry in Event Log,How to Fix Problem - BCCode 9f (Minidump included). Windows 7 x64?,[Solved] Black screen on wake-up, but mouse moves cursor arrow,How Can You Fix - Bad Pool Header crashes?,[Solution] Base.exe Error Code - Windows Professional 7

没有评论:

发表评论

注意:只有此博客的成员才能发布评论。