简体   繁体   中英

Process.start in c#, not firing

I am trying to create some files using fsutil, but no files are getting created with the following loop, neither is an error getting generated, any suggestions?

foreach (string extension in extensions)
{
   Process.Start("fsutil", @"file createnew e:\attachments\" + DateTime.Now.ToString() + extension); 
}

DateTime.Now.ToString() might be returning spaces and characters that aren't allowed in filenames. Try quoting the filename for the argument string and replacing any colons with underscores, or the like. FSUTIL also requires the length of the file to be specified, as ArsenMkrt stated.

Usage : fsutil file createnew <filename> <length>
   Eg : fsutil file createnew C:\testfile.txt 1000

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM