1,创建快捷方式:
1, download:http://optimumx.com/download/Shortcut.zip
or http://files.cnblogs.com/netact/Shortcut.zip
解压文件到你的目录 (for example). Now, suppose you want to create a shortcut for a file called scrum.pdf (also on desktop):
1. open CMD and go to desktop folder
2. run: Shortcut.exe /f:"%USERPROFILE%Desktopsc.lnk" /a:c /t:%USERPROFILE%Desktopscrum.pdf
it will create a shortcut called sc.lnk on your desktop that will point to the original file (scrum.pdf)
第二种方式:
我的用法:
@echo off
set CurrentDir=%cd%
set Source=nircmd.exe
set sfile=%cd%\%Source%
nircmd.exe shortcut "%sfile%" "~$folder.desktop$" "NirCmd"
http://nircmd.nirsoft.net/shortcut.html
IF "%1"=="" (SET mode=Release) else (SET mode=%1)
cd ../
set ROOT_DIR=%cd%
set MSBUILD="C:WindowsMicrosoft.NETFrameworkv4.0.30319MSBuild.exe"
IF %mode%==Release (
%MSBUILD% HP.WWSpc.sln /t:Rebuild /P:Configuration=Release /p:PlatformTarget=x86
@Rem ;Platform=x86
)
IF %mode%==Debug (
%MSBUILD% HP.WWSpc.sln /t:Rebuild /P:Configuration=Debug /p:PlatformTarget=x86
@Rem ;Platform=x86
)
if exist "Output" RMDIR /s /q Output //删除文件
::ww-spc Explorer @rem make dir ,create folder
mkdir OutputExplorer
xcopy /y /c /E /k /x Clientin\%mode%*.* OutputExplorer //复制所有文件及子文件和文件夹等
::ww-spc Server
mkdir OutputServer
xcopy /y /c /E /k /x ServerHostin\%mode%*.* OutputServer
var dr = MessageBox.Show("You have modified the configuration. If you have to restart this application to apply the changes. Click "Yes" to Restart this appplication, Click "No" to Continue run this application.", "Configuration changed", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { string fname = "RestartApplcation.bat"; File.WriteAllText(fname, "ping 1.1.1.1 -n 1 -w 2000 > nul"+Environment.NewLine + "start "" ""+ Application.ExecutablePath +""" + Environment.NewLine + "exit" ); System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; startInfo.FileName = fname; //startInfo.Arguments = "/C ping 1.1.1.1 -n 1 -w 2000 > nul & "+Application.ExecutablePath+ " && exit"; process.StartInfo = startInfo; process.Start(); Program.server.Close(); }