BAT文件写入具有随机名称的文件夹 [英] BAT file to write to a folder that has random name

查看:292
本文介绍了BAT文件写入具有随机名称的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个BAT文件,该文件将文件写入每个用户配置文件中名称不同的文件夹。

I am trying to create a BAT file that will write a file to a folder that is named something different within each users profile.

我想将文件复制到以下文件夹...

I would like to copy a file to the following folder...

C:\ Users \%username% \AppData \本地\ Google + \\ Chrome \用户数据\Default \Pepper Data \ Shockwave Flash \ WritableRoot \#SharedObjects \T2SHBFKV \program.kwtears.com \ #hwtears \ kwt \

C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects\T2SHBFKV\program.kwtears.com\#hwtears\kwt\

每个用户不同的文件夹是:T2SHBFKV

The folder that is different for each user is: T2SHBFKV

  I发现以下但是无法适应它以满足我的需求而且我希望有人可以帮助....

 I found the following but could not adapt it to suite my needs and I was hoping someone could help....







运行时我没有收到错误但是文件未复制。  那说当我拿"&\\program.kwtears.com \ #hwtears \ kwt \"时我可以写入随机文件夹,但它只是无法写入
随机文件夹中的任何子文件夹。

When this runs I do not get an error but the file is not copied.  That said when I take the "\program.kwtears.com\#hwtears\kwt\" out I am able to write to the random folder but it just simply can't write to any of the sub folders within that random folder.

感谢您的帮助!

推荐答案

试试这个:

@echo off

set Folder1 =%UserProfile%\ AppData \本地\Google \Chrome \用户数据\Default \Pepper Data \ Shockwave Flash \ WritableRoot \#SharedObjects

/ D% %a in("%Folder%\ *。*")确实设置了Folder2 = %% a \\\ program.kwtears.com \ #hwtears \ kwt



echo%Folder2%

@echo off
set Folder1=%UserProfile%\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\WritableRoot\#SharedObjects
for /D %%a in ("%Folder%\*.*") do set Folder2=%%a\program.kwtears.com\#hwtears\kwt

echo %Folder2%


这篇关于BAT文件写入具有随机名称的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆