batch-file - 有没有办法在 bat 脚本中评估字符串文字中的变量?
问题描述
假设我有一个包含这样的字符串的变量......
set test=%%userprofile%%\Desktop\test.txt
如果你要回显 %test% 你会看到......
%userprofile%\Desktop\test.txt
一个人将如何获取该值并假设删除该文件?如果我执行以下操作...
del %test%
我得到...
"The system cannot find the path specified."
不知何故,我需要它来评估文字“%userprofile%”到用户的真实用户配置文件位置,以在他们的桌面上找到文件。有什么想法吗?
解决方案
推荐阅读
- ionic-framework - 如何将 Ionic Hotspot 插件与 cordova-android: 8.0.0 一起使用?
- python-3.x - 如何在 1 中合并 2 个数据透视表(DataFrame 对象)
- python - 使用 PyCharm 导入类型时未解决的引用
- excel - VBA根据表格中的ColorIndex为整行着色
- vba - Powerpoint VBA makro 以幻灯片模式移动 w。2 个屏幕 + VBA 文本字段已禁用
- c# - 如何使弹出窗口出现在特定角落
- python - 创建可导入的python库
- probability - 掷两个骰子结果相同的几率似乎比我想象的要普遍
- android - 如何在android上的键盘视图中创建编辑文本
- reactjs - 在 Axios 请求反应后更新从父级到子级的传递数据