English 中文(简体)
日期:
原标题:Old Skool Batch File To Open Explorer at a Dated Location

我希望有一份简单的目录,以便当我两次点击批量档案时,它将在C:TempDownloads开启一个新的探索者案例。 YYYYMMDD, 如今是YYYYMMDD。

我认为,旧的Skool .bat案是最好的出路,但我可以拿起日期变量,通过“开始探索者”指挥。 我认为,我可以使用PowerShell,因为如果你对方案进行双重点击,则不可能运行。 因此,我认为这批人会做得更好?

Many thanks, Bertie

P.s. 我有以下的PS1号文字,我可以使用PowerShell 从一个批号上传。 我的国策。 PS1

$TodaysDate = Get-Date -format "yyyyMMdd"
$PathTarget =  W:Counterparty1Statements 
$LaunchFolder = $PathTarget + $TodaysDate
Explorer $LaunchFolder
问题回答
@echo off
for /F "tokens=1-3 delims=/" %%a in ("%date%") do set TodaysDate=%%c%%a%%b
explorer "C:TempDownloads\%TodaysDate%"

我强烈建议不依靠<条码>%<%>>>>,因为你的打字本可能会与其他区域环境发生故障。

在这里,它如何利用大米:

@echo off

FOR /F "skip=1 tokens=1-6" %%A IN 
( WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table )
DO (
SET /A TODAY=%%F*10000+%%D*100+%%A
)
explorer "C:TempDownloads\%TODAY%"




相关问题
complex batch replacement linux

I m trying to do some batch replacement for/with a fairly complex pattern So far I find the pattern as: find ( -name *.php -o -name *.html ) -exec grep -i -n hello {} + The string I want ...

How to split a string by spaces in a Windows batch file?

Suppose I have a string "AAA BBB CCC DDD EEE FFF". How can I split the string and retrieve the nth substring, in a batch file? The equivalent in C# would be "AAA BBB CCC DDD EEE FFF".Split()[n]

How to check which Operating System?

How can I check OS version in a batch file or through a vbs in an Windows 2k/2k3 environment ? You know ... Something like ... : "If winver Win2k then ... or if winver Win2k3 then ....

热门标签