Cómo arreglarlo "La ruta de archivo especificada no es absoluta, no está en el directorio system32, o no es válida".
Descripción del error
El mensaje de error. "The file path specified is either not absolute, not in the system32 directory, or not valid" typically occurs in the Windows Operating System when a program, script, or system utility attempts to execute a command or access a file using an improper directory path.
This error most frequently happens when users try to manage Windows services using the sc.exe (Service Control) command-line tool, registry edits, or Task Scheduler. Windows security protocols mandate that certain critical system tasks, drivers, and background services must reside strictly within the protected C:\Windows\System32 directory and must be invoked using a complete, unqualified, absolute file path (e.g., beginning with a drive letter like C:\ ). If the path uses relative notation, contains syntax typos, or points to a standard user directory, the system blocks the execution for security and system stability reasons.
Soluciones fáciles paso a paso
Siga estas soluciones estructuradas para resolver el problema.
Método 1: Corregir el formato de la ruta en el mensaje de comando (creación de servicios)
Si ha recibido este error mientras utiliza el sc create - ¿ Qué ? sc config comando para configurar un servicio de Windows, la sintaxis para la ruta binaria ( binPath ) is likely incorrect.
- Presiona el... Windows Key, tipo cmd Haga clic derecho. Command Prompt, y seleccione Run as administrator.
- Examine your original command. Ensure the executable file is physically located in
C:\Windows\System32. If it is not, move the executable file into that folder first. - Re-run your command using an absolute path enclosed in quotation marks, ensuring there is a strict space después de el
binPath=El argumento.- Sintáctica incorrecta:
sc create MyService binPath= "myservice.exe" - Sintáctica incorrecta:
sc create MyService binPath=C:\Folder\myservice.exe - La sintaxis es correcta:
sc create MyService binPath= "C:\Windows\System32\myservice.exe"
- Sintáctica incorrecta:
- Presione. Enter y comprobar si el servicio se crea con éxito.
Método 2: Verificar y corregir las rutas del Registro de Windows
Si un servicio o aplicación existente no se inicia y desencadena este error, la ruta almacenada en el Registro de Windows podría estar dañada o apuntar a la ubicación incorrecta.
- Presione. Windows Key + R, tipo regedit, y presiona Enter para abrir el Editor de Registro.
- Navigate to the following directory path using the left sidebar:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ - Haga clic en la subcarpeta que lleva el nombre del servicio o aplicación que causó el error.
- En el panel derecho, localice la cadena de registro llamada ImagePath.
- Haga doble clic. ImagePath para abrir sus propiedades.
- Check the value data field. If the path points to a file outside of System32 or lacks an absolute path, move your application binary to
C:\Windows\System32y actualizar los datos de valor para que coincidan exactamente con:- Ejemplo:
C:\Windows\System32\yourprogram.exe
- Ejemplo:
- Haga clic OK, close the Registry Editor, and restart your computer to apply the changes.
Método 3: Ajustar las variables ambientales
Si Windows no puede resolver el System32 el camino implícitamente debido a variables de sistema rotas, la actualización de la variable PATH resolverá el conflicto.
- Presiona el... Windows Key, tipo Environment Variables, y seleccione Edit the system environment variables.
- Haga clic en el Environment Variables... botón en la parte inferior de la ventana Propiedades del sistema.
- Bajo el... System variables sección (mitad inferior), desplácese hacia abajo, seleccione el Path variable, y haga clic Edit....
- Busca.
%SystemRoot%\system32- ¿ Qué ?C:\Windows\system32en la lista. - Si falta, haga clic en New on the right side and type:
C:\Windows\system32 - Haga clic OK en todas las ventanas abiertas para guardar las configuraciones y reiniciar las aplicaciones activas o las instrucciones de comando.
Puede haber algunos errores.. Learn Microsoft