windows 7 copy files pointed to by shortcuts [closed] - windows

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have a bunch of shortcuts to files that are in various places on my hard drive. The physical files need to be backed up. Any ideas on how to script this?
Thanks,
Scott

$files = gci ~\Desktop\*.lnk | %{$sh = New-Object -COM WScript.Shell}{$sh.CreateShortcut($_.fullname).Targetpath}

The only thing I can think of is reading the type of file in the directory as it's being backed up. if it's a ".lnk" you know it's a shortcut. At that point use something similar to this article:
http://social.technet.microsoft.com/Forums/nl/winserverpowershell/thread/0293e186-2a21-4677-b1a5-f4e501570a98
To return the Target Path to a variable and then process that variable as if it were a file and copy the actual file.
I hope this makes sense. I have experience with PowerShell but not this exact situation. However, this is the approach I would take.

Related

Removing windows aliases [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Recently, I gave some folders an alias for web sharing. The folders got cut and pasted out of their original location and then restored. The aliases were lost in the process yet when I try to reassign them the same alias it complains that the alias is taken. No other folder has these aliases only they did but that was lost in the cut and paste. Is there a system file somewhere or a registry I can edit to remove them so I can reapply them? The alias names are sensitive. The OS is Windows Server 2003.
I deleted the websites from IIS, refreshed and I was able to make the alias again.

Safety of opening .txt files [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
If I'm given a URL that points to a .txt file, is it always safe to open it? Can it possibly contain virus or malicious content?
A genuine txt-file can contain virus code but it cannot be executed, so it's totally safe. However, a file can use double file extension like this, so watch out:
a-virus-file.txt.exe
Windows hides by default .exe because it's a known file type.
It is not safe to rely solely on a file extension. The real file type can easily be masked by someone changing the extension, so the file could easily be a virus or malicious content.
For example:
MyVirus.exe -> SeeminglyHarmlessFile.txt

How to determine whether a drive is TrueCrypt mounted? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Is it possible, in a Windows batch file, to test if a certain drive letter was mounted by TrueCrypt?
I think this is not possible. You could get much information with wmic logicaldisk but nothing will indicate that Truecrypt assigned the drive letter.
As an Idea: (for anyone still finding this post)
You could make this C# Script over at the post #18021118 (which accesses truecrypt to retrive mount information) (there is also a VeraCrypt version over there.) ...
into a commandline tool to be used from your windows batch (added a simple example here: http://github.com/BananaAcid/VeraCrypt-Cmd - replace the get mounts file with the one from the readme within)
or use it directly with powershell
or with an additional binary wich executes scripts on the windows NET Framework without compiling: cs-script.

How to create a burn folder? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
my app needs to both burn discs and create burn folders. i'm able to use the DiscRecording framework, and am delving into its many options for the burn disc methods, and am starting to get that, but i don't see any reference to creating a 'burn folder'.
i've also looked in NSFileManager (thinking that it was a key that needs to be set), and also searched the docs and this site for 'burn folder', with no result.
it's probably that i am overlooking something really obvious about how to do this programmatically.
will anyone shed some light here?
thanks.
Just create a directory with an extension of .fpbf.

What is the trick with c:\program? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 13 years ago.
Improve this question
I found that taking any exe file, renaming it to program (without extension) and putting it in C:\ root folder might cause strange things in windows like showing this application when other programs start.
What is it? is it some kind of backdoor?
p.s if you restart windows after doing so - you get a warning about it.
thanks,
Adi Barda
Maybe the fact that some programs don't know how to access C:/Program Files/. because it has a space. Then they are trying to execute C:/program, which in your case turns out to be the file you created.

Resources