soarli

计划任务自启frp
前两天在张贺林博客上学到了一个快速打开启动文件夹的命令:shell:startup但是每次登陆系统才能运行,类似于...
扫描右侧二维码阅读全文
07
2021/06

计划任务自启frp

前两天在张贺林博客上学到了一个快速打开启动文件夹的命令:

shell:startup

但是每次登陆系统才能运行,类似于之前搞的启动文件夹.bat

@echo off
explorer %systemdrive%\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp


%注释:

是指一些以%SystemRoot%(以“%名称%”表示)开头的路径。它的作用是告诉系统,我要定位的文件(夹)在系统分区Windows目录下。比如你要进入Windows下的system32文件夹,只而在IE浏览器的地址栏,或“运行”对话框中输入“%SystemRoot%system32”(如图3),回车即可,而不必注明系统分区是C盘还是D盘,因为系统路径会自动定位查找到系统分区的。再说的直白一点,它的作用其实就相当于一个绝对路径:X:Windows(其中X为系统分区盘符)。

  下面,我们以安装在C盘并使用默认系统文件夹、当前用户名是Administrator的Windows XP系统为例,罗列几个常用的系统路径所对应的绝对路径。

  系统路径含义系统路径(不区分大小写)对应的绝对路径 
  当前系统盘符%systemdrive%或%HOMEDRIVE%C: 
  当前系统目录%systemroot%或%Windir%C:WINDOWS 
  当前用户文件夹%UserProfile%或%HOMEPATH%C:Documents and SettingsAdministrator 
  所有用户文件夹%AllUsersProfile%C:Documents and SettingsAll Users 
  临时文件夹1%temp%C:Documents and SettingsAdministratorLocal SettingsTemp 
  临时文件夹2%SystemRoot%TEMPC:WINDOWSTemp 
  程序文件夹%ProgramFiles%C:Program Files
信息来源:http://www.360doc.com/content/14/0216/18/15723785_353007174.shtml
信息整合:soarli
%

今天尝试使用计划任务实现开机自动启动(用开机棒开机后再也不用多关一次广告了):


frp.bat

timeout /nobreak /t 10
d:
cd frp_0.30.0_windows_amd64
frpc.exe

frp.xml

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2021-06-07T20:14:03.6326795</Date>
    <Author>PC-202101181242\Administrator</Author>
    <URI>\frp</URI>
  </RegistrationInfo>
  <Triggers>
    <BootTrigger>
      <Enabled>true</Enabled>
    </BootTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>xxxxxx</UserId>
      <LogonType>Password</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>false</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>false</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>C:\startup\frp.bat</Command>
    </Exec>
  </Actions>
</Task>

参考资料:

https://blog.csdn.net/pfm685757/article/details/53176973

https://www.qinziheng.com/hulianwangjia/9051.htm

最后修改:2021 年 06 月 07 日 10 : 43 PM

发表评论