If your doing this on windows, there is an entire api sub set for manipulating files and directories above the native things in c++. You wouldn't use the system command for this. Linux should have a similar api. Doing these things aren't native to c++ they are extensions to it by the operating systems api.
Did you seriously start a thread so you could ask how to make a virus? Honestly, that's just stupid. Besides, viruses are usually malicious and destructive; your code isn't either of them. Not only that, the target's AV will detect the heavy use of system( ) and mark it a untrusted.
A real malicious program would be a root-kit. Either way, Azagaros has the right idea.
To really hide a file from all programs use a kernel mode driver. There is a working sample in codeproject website which can hide files and folders, also hide running processes from task manager. Don't remember the link right now ...
Did you seriously start a thread so you could ask how to make a virus? Honestly, that's just stupid. Besides, viruses are usually malicious and destructive; your code isn't either of them.
For me the important part of being classed as a virus is the way it self replicates. A virus is a specific type of malware and is distinct from worms, Trojan horses, rootkits, spyware and other malware.
@ OP: Due to Lines 10 and 11 this is technically a logic bomb, a poor example of one for sure but that's the closest malware description that this fits. The use of "cd" and "attrib" makes this specific to windows so since you already know the syntax why wouldn't you just use a batch file? The profanity is uncalled for, please refrain from doing this in the future.