Fergieman
(Getting the hang of it)
2015-09-17 02:34 PM
Can I turn this into KIXTart code?

Aplogies, my scripting is terrible based on the fact that I work purely in Infrastucture.
Anyway ,I have the following VBS script code which renames mapped drives. Is there away for me to convert this so it runs with my kixtart code for my users at logon.

Set oShell = CreateObject("Shell.Application")
oShell.NameSpace("H:\").Self.Name = "account"


AllenAdministrator
(KiX Supporter)
2015-09-17 03:37 PM
Re: Can I turn this into KIXTart code?

Label('c:\','my fancy new name')


Label -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=83870

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1


Fergieman
(Getting the hang of it)
2015-09-29 02:07 PM
Re: Can I turn this into KIXTart code?

Thanks Allen
I got the UDF and created the syntax as above. It runs without any errors but doesn't re-label the drive


Fergieman
(Getting the hang of it)
2015-09-29 02:08 PM
Re: Can I turn this into KIXTart code?

Wait...it works on the C: drive but not the network drive I have mapped

AllenAdministrator
(KiX Supporter)
2015-09-30 12:06 AM
Re: Can I turn this into KIXTart code?

Not sure why its not working, but I also tested the label udf on Win8.1 and while it returns "The operation completed successfully", the label does not change. Tried running under normal and admin. Seems like to me I have used this in the past, so it could be something to do with Windows.

What version are you testing on?


Glenn BarnasAdministrator
(KiX Supporter)
2015-09-30 12:54 AM
Re: Can I turn this into KIXTart code?

FWIW - the MapDrive() UDF that I wrote can update the label. I works on all platforms, including Windows 8, 8.1, and 10. That UDF uses the same logic as your VB code converted to Kix. One thing that this UDF does is waits for a valid connection after mapping before writing the drive label.

The latest version - 1.5 - can be downloaded from my web site. Use it as is or not, you might be able to see what's not working with your code.

Glenn


LonkeroAdministrator
(KiX Master Guru)
2015-09-30 01:25 PM
Re: Can I turn this into KIXTart code?

That's weird. Since its using shell, it should fail with error if drive is not there. I remember doing my original label as registry write and that required persistent connections to work properly. I don't see any reason why this would have same symptoms.