Comment réparer "Le chemin de fichier spécifié n'est pas absolu, pas dans le répertoire system32, ou n'est pas valide".
Description de l'erreur
Le message d' erreur. "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.
Des solutions faciles étape par étape
Suivez ces solutions structurées pour résoudre le problème.
Méthode 1: corriger le format du chemin dans la clause de commande (création de service)
Si vous avez reçu cette erreur en utilisant le sc create ou... sc config commande de configuration d'un service Windows, la syntaxe du chemin binaire ( binPath ) is likely incorrect.
- Appuie sur le... Windows Key, type cmd, cliquez avec le bouton droit. Command Prompt, et sélectionnez 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 après le
binPath=Je vous en prie.- Syntaxe incorrecte:
sc create MyService binPath= "myservice.exe" - Syntaxe incorrecte:
sc create MyService binPath=C:\Folder\myservice.exe - La syntaxe est correcte:
sc create MyService binPath= "C:\Windows\System32\myservice.exe"
- Syntaxe incorrecte:
- Appuyez dessus. Enter et vérifier si le service a été créé avec succès.
Méthode 2: Vérifier et corriger les chemins du registre Windows
Si un service ou une application existante ne démarre pas et déclenche cette erreur, le chemin stocké dans le Registre Windows peut être corrompu ou pointant vers le mauvais emplacement.
- Appuyez dessus. Windows Key + R, type regedit, et appuyez Enter pour ouvrir l'éditeur de registre.
- Navigate to the following directory path using the left sidebar:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ - Cliquez sur le sous-dossier nommé d'après le service ou l'application spécifique à l'origine de l'erreur.
- Dans le volet droit, localiser la chaîne de registre nommée ImagePath.
- Double-cliquez. ImagePath pour ouvrir ses propriétés.
- 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\System32et mettre à jour les données de valeur pour qu'elles correspondent exactement à:- À titre d'exemple:
C:\Windows\System32\yourprogram.exe
- À titre d'exemple:
- Cliquez. OK, close the Registry Editor, and restart your computer to apply the changes.
Méthode 3: Ajustez les variables de l'environnement
Si Windows ne parvient pas à résoudre le System32 le chemin implicitement en raison de variables du système cassées, la mise à jour de la variable PATH résoudra le conflit.
- Appuie sur le... Windows Key, type Environment Variables, et sélectionnez Edit the system environment variables.
- Cliquez sur le Environment Variables... le bouton en bas de la fenêtre Propriétés du système.
- Sous le... System variables section (moitié inférieure), faites défiler vers le bas, sélectionnez le Path variable, et cliquez Edit....
- Regardez.
%SystemRoot%\system32ou...C:\Windows\system32dans la liste. - Si elle manque, cliquez New on the right side and type:
C:\Windows\system32 - Cliquez. OK sur toutes les fenêtres ouvertes pour enregistrer les configurations et redémarrer les applications actives ou les commandes.
Il y a peut-être des erreurs.. Learn Microsoft