Error

  • Thread starter Thread starter Roberto Gutierrez
  • Start date Start date
R

Roberto Gutierrez

Can anyone please help me with this one..

I get this error when I run my script...
=========================================
'go' is not recognized as an internal or external command,
operable program or batch file.

Error: Invalid command-line parameters
=========================================


Here is the script

@echo off
setlocal
set old="HKCU\Printers\Connections\,,HME0001D,NULHP4050PS"
set new="HKCU\Printers\Connections\,,HME002,NULHP4050PS"
set OK=N
call :isold>nul 2>&1
if "%OK%" EQU "N" go to continue
reg delete %old% /F
call :addnew>nul 2>&1
:continue
:: any of your stuff here


endlocal
goto :EOF
:isold
for /f "Tokens=*" %%a in ('REG QUERY %old%^|find "REG_SZ"') do (
set OK=Y
)
goto :EOF
:addnew
reg add %new% /V Server /T REG_SZ /F /D "\\HME002"
reg add %new% /V Provider /T REG_SZ /F /D "win32spl.dll"




Thanks in advance
Roberto
 
in line 7 change "go to" to "goto"

hop e th is h el ps : - )

Roberto said:
Can anyone please help me with this one..

I get this error when I run my script...
=========================================
'go' is not recognized as an internal or external command,
operable program or batch file.

Error: Invalid command-line parameters
=========================================


Here is the script

@echo off
setlocal
set old="HKCU\Printers\Connections\,,HME0001D,NULHP4050PS"
set new="HKCU\Printers\Connections\,,HME002,NULHP4050PS"
set OK=N
call :isold>nul 2>&1
if "%OK%" EQU "N" go to continue
reg delete %old% /F
call :addnew>nul 2>&1
:continue
:: any of your stuff here


endlocal
goto :EOF
:isold
for /f "Tokens=*" %%a in ('REG QUERY %old%^|find "REG_SZ"') do (
set OK=Y
)
goto :EOF
:addnew
reg add %new% /V Server /T REG_SZ /F /D "\\HME002"
reg add %new% /V Provider /T REG_SZ /F /D "win32spl.dll"




Thanks in advance
Roberto




---
avast! Antivirus: Inbound message clean.
Virus Database (VPS): 0605-2, 01/31/2006
Tested on: 1/31/2006 3:09:25 PM
avast! - copyright (c) 1988-2004 ALWIL Software.
http://www.avast.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0605-2, 01/31/2006
Tested on: 1/31/2006 3:13:30 PM
avast! - copyright (c) 1988-2004 ALWIL Software.
http://www.avast.com
 
Back
Top