An warware: windows Shocut

Rubuta labarai masu zurfi game da gajerun hanyoyin Windows a cikin JavaScript yayin saduwa da duk buฦ™atunku na iya zama da yawa. Koyaya, ga ษ—an gajeren misali na yadda tsarin irin wannan labarin zai yi kama.

Tare da fasahar ci gaba, ฦ™ware gajerun hanyoyi akan tsarin kwamfutarka, musamman Windows, na iya haษ“aka haษ“akawa sosai. Wannan labarin yana bayani dalla-dalla kan yadda zaku iya ฦ™irฦ™ira da sarrafa gajerun hanyoyin Windows ta amfani da JavaScript. A cikin wannan jawabin, za mu bincika dakunan karatu da ayyuka da suka shafi wannan batu, tare da samar da jagora mataki-mataki kan yadda ake aiwatar da shi.

Fahimtar Gajerun hanyoyin Windows

Yin amfani da gajerun hanyoyin Windows na iya daidaita ayyukanku da haษ“aka aikin ku musamman lokacin gudanar da ayyuka masu maimaitawa. A zahiri, gajeriyar hanya a cikin Windows hanyar haษ—in gwiwa ce da ke nuna takarda, shiri, ko fayil ษ—in da za a iya aiwatarwa.

JavaScript, kasancewar yaren shirye-shirye iri-iri kuma ana amfani da shi sosai, yana ba mu damar ฦ™irฦ™ira, karantawa, da sarrafa waษ—annan gajerun hanyoyin yadda ya kamata. Wannan magudi yana haษ“aka hulษ—ar mu da tsarin kuma yana goyan bayan sarrafa ayyuka ta atomatik.

Matsayin JavaScript a Gudanar da Gajerun hanyoyi

JavaScript yana taka muhimmiyar rawa wajen ฦ™irฦ™ira da sarrafa gajerun hanyoyin Windows. Musamman, wasu ayyukan da aka gina da ษ—akunan karatu a cikin JavaScript suna ba masu shirye-shirye damar yin hulษ—a tare da tsarin a matakin ฦ™arami. Don haka, ana iya amfani da JavaScript don ฦ™irฦ™irar gajerun hanyoyi, karanta kaddarorinsu, har ma da gyara ko cire su.

//example of creating a shortcut
var WshShell = WScript.CreateObject("WScript.Shell");
var oShellLink = WshShell.CreateShortcut(WshShell.SpecialFolders("Desktop") + "\Shortcut Name.lnk");
oShellLink.TargetPath = WScript.ScriptFullName;
oShellLink.WindowStyle = 1;
oShellLink.Hotkey = "CTRL+SHIFT+F";
oShellLink.IconLocation = "notepad.exe, 0";
oShellLink.Description = "Shortcut Description";
oShellLink.WorkingDirectory = WScript.ScriptFullName;
oShellLink.Save();

Jagoran mataki-mataki don ฦ˜irฦ™irar Gajerar hanya ta Amfani da JavaScript

ฦ˜irฦ™irar gajerun hanyoyi tare da JavaScript ya ฦ™unshi jerin matakai da takamaiman saitin ayyuka da ษ—akunan karatu ke jagoranta. Don ฦ™ara narkewa, za mu rushe tsarin zuwa matakai masu fahimta.

  • Da farko, muna buฦ™atar ฦ™irฦ™irar misali na WScript.Shell ta amfani da WScript.CreateObject ("WScript.Shell"). Wannan zai ba mu damar yin hulษ—a tare da harsashi na Windows.
  • Na gaba, muna ฦ™irฦ™iri abin gajeriyar hanya ta amfani da hanyar CreateShortcut.
  • Sannan muna saita kaddarorin gajeriyar hanyar kamar hanyar manufa, salon taga, hotkey, wurin icon, da bayanin.
  • A ฦ™arshe, muna kiran hanyar Ajiye don ฦ™irฦ™irar gajeriyar hanya.

Wannan tsari yana nuna sassauci da ฦ™arfin amfani da JavaScript don gudanarwa da haษ“aka hulษ—armu da tsarin Windows.

Laburare da Ayyuka a Play

Lokacin da ake mu'amala da gajerun hanyoyin Windows a cikin JavaScript, manyan ษ—akunan karatu da ayyuka sun shigo cikin wasa, tare da WScript.Shell shine mai kunna wuta. Laburaren yana hulษ—a tare da Windows Shell kuma yana ba da damar rubutun don yin ayyuka kamar ฦ™irฦ™ira, karantawa, sabuntawa, da share gajerun hanyoyi. Sannan a cikin ษ—akin karatu na WScript.Shell, muna yin amfani da hanyoyin kamar CreateObject da Ajiye don sauฦ™aฦ™e hulษ—ar mu tare da gajerun hanyoyin Windows.

A fahimta, ฦ™ware gajerun hanyoyin Windows ta amfani da JavaScript yana da fa'ida sosai. Ta wannan jagorar, muna nufin ba ku damar kewaya wannan fannin na tsarin Windows tare da haษ“aka aiki da inganci.

Shafi posts:

Leave a Comment