سؤال

وأنا عادة الرجل لينكس، ولكن أنا بحاجة لكتابة السيناريو دفعة على ويندوز لتغيير الهدف من بعض الاختصارات. هناك أمر للقيام بذلك؟

هل كانت مفيدة؟

المحلول

وأشك هل هناك طريقة للقيام بذلك مع برنامج نصي دفعة واحدة. انها قابلة للتنفيذ في VBScript، وإن كان.

Set sh = CreateObject("WScript.Shell")
Set shortcut = sh.CreateShortcut("C:\Wherever\Shortcut.lnk")
shortcut.TargetPath = "C:\Wherever\Whatever.txt"
shortcut.Save

وحفظ البرنامج النصي في ملف تنتهي في فبس وتشغيلها من سطر الأوامر باستخدام cscript whatever.vbs.

و(لا ينخدع اسم - يستخدم CreateShortcut على حد سواء إنشاء وتعديل الاختصارات)

نصائح أخرى

وليس هناك البرنامج الأصلي الذي يأتي مع ويندوز لتحقيق ذلك. I تجوب الإنترنت لهذه الوظيفة نفسها منذ لحظة وعثر عليها البرمجيات الحرة XXMKLINK .

<اقتباس فقرة>   

ومع XXMKLINK، يمكن أن تكتب دفعة   ملف للبرمجيات       تثبيت الذي قامت به instllation المتخصصة       البرامج. في الأساس، XXMKLINK هو جمع المعلومات       من سطر الأوامر وحزمه في اختصار.

     

وبناء جملة الأمر من XXMKLINK:

xxmklink spath opath [ arg [ wdir [ desc [ mode [ icon[:n] ]]]]]

where 

  spath     path of the shortcut (.lnk added as needed)
  opath     path of the object represented by the shortcut
  arg       argument string (use quotes with space, see below)
  wdir      path of the working directory (for "Start in")
  desc      description string (shown in Shosrtcut's Properties)
  mode      display mode (1:Normal [default], 3:Maximized, 7:Minimized)
  icon[:n]  icon file [with optional icon index value n]

  In addition to the above, the following switches are supported
  which can be placed in any position in the command line.

  /p        prompts before action
  /q        no output when successful (quiet)
  /e        checks error condition strictly

والجانب السلبي هو أنك سوف تحتاج إلى نسخ إكس xxmklink على كل كمبيوتر مع البرنامج النصي دفعة واحدة.

وصلة لتحميل وهي متوفرة في الجزء السفلي من الصفحة المرتبطة.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top