كيفية إصلاح "The file path specified is either not absolute, not in the system32 directory, or not valid."
وصف الخطأ
رسالة الخطأ "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.
حلول سهلة خطوة بخطوة
اتبع هذه الحلول المنظمة لحل المشكلة.
طريقة 1: تصحيح تنسيق المسار في طلب الأوامر (إنشاء الخدمة)
إذا تلقيت هذا الخطأ أثناء استخدام sc create أو sc config أمر لإنشاء خدمة ويندوز ، والحرفية للطريق الثنائي ( binPath ) is likely incorrect.
- اضغط على Windows Key ، نوع cmd انقر على الزر الأيمن Command Prompt ، وتحديد 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 بعد الـ
binPath=الجدال.- نحو خاطئ:
sc create MyService binPath= "myservice.exe" - نحو خاطئ:
sc create MyService binPath=C:\Folder\myservice.exe - الجملة الصحيحة:
sc create MyService binPath= "C:\Windows\System32\myservice.exe"
- نحو خاطئ:
- اضغط Enter وتحقق من إنشاء الخدمة بنجاح.
طريقة 2: التحقق وتصحيح مسارات سجل ويندوز
إذا فشلت خدمة أو تطبيق موجود في البدء وأثار هذا الخطأ ، فقد يكون المسار المخزن في سجل Windows تالفاً أو يشير إلى الموقع الخاطئ.
- اضغط Windows Key + R ، نوع regedit و اضغط Enter لفتح محرر السجل
- Navigate to the following directory path using the left sidebar:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ - انقر على المجلد الفرعي الذي يحمل اسم الخدمة أو التطبيق المحدد الذي يسبب الخطأ.
- في النافذة اليمنى، ابحث عن سلسلة السجل المسماة ImagePath.
- انقر مرتين ImagePath لفتح ممتلكاتها.
- 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\System32وتحديث بيانات القيمة لتتطابق بالضبط مع:- مثال:
C:\Windows\System32\yourprogram.exe
- مثال:
- انقر OK, close the Registry Editor, and restart your computer to apply the changes.
الطريقة 3: تعديل المتغيرات البيئية
إذا كانت ويندوز لا تستطيع حل System32 الطريق بشكل ضمني بسبب متغيرات النظام المكسورة، تحديث متغير PATH سيحل النزاع.
- اضغط على Windows Key ، نوع Environment Variables ، وتحديد Edit the system environment variables.
- اضغط على Environment Variables... زر في أسفل نافذة خصائص النظام.
- تحت... System variables قسم (النصف السفلي) ، انعطف لأسفل، حدد Path المتغير، ونقر Edit....
- ابحث عن
%SystemRoot%\system32أوC:\Windows\system32في القائمة. - إذا كانت مفقودة، انقر على New on the right side and type:
C:\Windows\system32 - انقر OK على جميع النوافذ المفتوحة لحفظ التكوينات وإعادة تشغيل أي تطبيقات نشطة أو طلبات الأوامر.
قد يكون هناك بعض الأخطاء. Learn Microsoft