move running files in windows

本文提供了一个C语言程序示例,展示了如何在Windows环境下安全地删除系统文件。通过使用临时文件和MoveFileEx函数,该程序绕过了Windows的sfc机制,实现了对指定文件的有效删除。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

first of all, you must remove the windows sfc mechanism if the files belong to system.


#include <Windows.h>
BOOL del_file_func(char *szFileToDel)
{
char cTempFileName[0x80];
char cTempPathName[0x100];
char cFileName[0x100];
if(szFileToDel[1] == ':')
{
sprintf(cTempPathName, "%c://", szFileToDel[0]);
}
else
{
GetModuleFileName(NULL, cFileName, 0x100);
sprintf(cTempPathName, "%c://", cFileName[0]);
}
if(GetTempFileName(cTempPathName, "_x", 0, cTempFileName) == 0)
{
return FALSE;
}
if(MoveFileEx(szFileToDel, cTempFileName, 1) == 0)
{
return FALSE;
}
if(MoveFileEx(cTempFileName, NULL, 4) == 0)
{
return FALSE;
}
return TRUE;
}
void usage(char *str)
{
printf("usage:/n/t %s FileNeedToDel/n", str);

return;
}
int main(int argc, char *argv[])
{
printf("/ncodz by xHydra./nQQ:150892418/nemail:xhydra@126.com/n");
if (argc != 2)
usage(argv[0]);
if(del_file_func(argv[1]) == TRUE)
{
printf("/nfile deleted successfully.");
}
else
{
printf("/nerror %d", GetLastError());
return FALSE;
}
return TRUE;
}
design a plugin for files of screen-recording's moving to different disks of Xbox in PC. reply in Chinese.the detailed of process, and necessary profiles and their codes(C series codes is required).(rules:1.detect and find the enough and largest space between the disks and list priority sequence but the disk where the running game in(default mode) , customizing mode is alternative;2. for the recording files, if choose default mode, set a default value such as 1GB for recordings and 10MB for screenshots, they all depends on the resolution of the screen(could find the minimum size of files of different resolutions to fill the default mode),it could customize the minimun size;3.for customize mode, it should detect 2 first and then is 1 to check whether the disks are allowed to move, if not, show popup window to tell the info and cancel(but don't pop the window when running a games), if enough, run the moving as what mode you've chosen, so do as default mode;4.for different games-recording, they could also be classified when moved to different disks or even the same disks but different files;5.for different games-recording, the files' sizes are smaller the customized values but not only one file, cumulating all of them first then run the rule 2 before the disks is full(default mode different before),and number of files could be customized despite of the size of these files aren't enough to move, and it could give the alternations like according to games(give a priority sequence based the number of repeated names of games-recording), size(from larger to smaller, they all need to smaller than size mentioned in rule 2), number(could customize it) (this is customized mode different before);6.screenshot are alternative in the rule, but when it run the rule 4, it need to be classified to different files where the same games-recording files in;7.when there is a game is running, pause the moving, especially the disk where the running games in;8.to avoid the difficulty of management with the scattered files, no need to run the rule 1 when every time(but not first time you reboot the computer after you install the plugin) computer booting or game recording until the overflow of disk no matter what mode you've chosen and then pop up to rechoose the mode;9.if a disk is overflow when moving a file of game-recording, cancel to move it to the new chosen disk, add number in the files' name;10.to avoid to frequent moving of files, it could set a threshold of system disk, pop up the tip when the threshold is about to arrive before recording, threshold setting: it could choose proportion(%) or values(the customized space threshold of system disk) ;11.choose the unused cores of CPU as priority.
06-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值