Batch file failing on Windows 7 due to administrative privileges

We still use an old terminal emulator called MiniSoft92 to access our HP3000. The program is pretty simple and I've used a batch file to "install" it on WinXP systems. Basically, it just copies files to the local drive off the network, puts a font into the Windows fonts folder, and a shortcut to the executable on the shared desktop. I modified the batch to run on Win7, but the batch fails. Specifically when trying to install the font, and placing the shortcut on the shared desktop.

It seems to be an administrative rights issue. And it doesn't matter if the user running the batch is a member of the local administrators group, if you run it while logged in as the local admin, or if you r-click the batch file and Run As Administrator. In fact, if you do the last, the batch doesn't run at all, where at least it will copy all the files under the other methods.

What am I missing, or what can I add to the batch to get this to run correctly on Win7?

Here's a copy of the batch:
@echo off
cls
c:cd
md ms9232
net use x: \swik-s-fs01winapps

COPY /Y x:HPMANMANms9232*.* c:ms9232
mkdir C:MS9232WS92
COPY /Y x:HPMANMANms9232WS92*.* c:ms9232WS92
COPY /Y c:ms9232W92.FON C:WINDOWSFONTS
COPY /Y c:ms9232HPMANMAN.LNK "C:UsersPublicPublic Desktop"

net use x: /d



I don't think you can straight copy a font into the Fonts folder and make it work. There are other ways, though. Check out this article:
https://social.technet.microsoft.com/Forums/scriptcenter/fr-FR/228ca988-6673-49f5-be73-a6a6f83c489d/install-fonts-using-a-batch-file-need-help-getting-the-coding-correct?forum=ITCG



I don't think you can straight copy a font into the Fonts folder and make it work. There are other ways, though. Check out this article:
https://social.technet.microsoft.com/Forums/scriptcenter/fr-FR/228ca988-6673-49f5-be73-a6a6f83c489d/install-fonts-using-a-batch-file-need-help-getting-the-coding-correct?forum=ITCG



Interesting. The batch worked fine in WinXP. Anyway, should I be able to create a 4-line vbs script and have the batch file call/launch it?

What about getting the link copied to the shared desktop?



Here's a way to install fonts via the network using FontReg:http://community.spiceworks.com/topic/416412-how-to-install-fonts-remotely?page=1#entry-4059230



To copy to the desktop, try this:
copy /Y c:ms9232HPMANMAN.LNK %public%DesktopHPMANMAN.LNK

http://www.itninja.com/question/copy-a-shortcut-to-all-users



Have you tried right click, run as administrator on the batch file? By default UAC means that although Administrator has rights to a directory in NTFS permissions it only gets the rights assigned to normal "users" group unless you do this.

If you have a domain you can easily push down fonts using a group policy and while you are at it the app too if wanted.

If you use these paths too they should work regardless of the settings on a PC:
"%public%desktop" instead of c:userspublic etc.
"%windir%fonts" instead of c:windowsfonts

Steve

Share this

Related Posts

There was an error in this gadget