Page 1 of 1 1
Topic Options
#210749 - 2015-09-17 02:34 PM Can I turn this into KIXTart code?
Fergieman Offline
Getting the hang of it

Registered: 2010-02-25
Posts: 58
Loc: Ireland
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"

Top
#210752 - 2015-09-17 03:37 PM Re: Can I turn this into KIXTart code? [Re: Fergieman]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
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

Top
#210759 - 2015-09-29 02:07 PM Re: Can I turn this into KIXTart code? [Re: Allen]
Fergieman Offline
Getting the hang of it

Registered: 2010-02-25
Posts: 58
Loc: Ireland
Thanks Allen
I got the UDF and created the syntax as above. It runs without any errors but doesn't re-label the drive

Top
#210760 - 2015-09-29 02:08 PM Re: Can I turn this into KIXTart code? [Re: Fergieman]
Fergieman Offline
Getting the hang of it

Registered: 2010-02-25
Posts: 58
Loc: Ireland
Wait...it works on the C: drive but not the network drive I have mapped
Top
#210761 - 2015-09-30 12:06 AM Re: Can I turn this into KIXTart code? [Re: Fergieman]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
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?

Top
#210762 - 2015-09-30 12:54 AM Re: Can I turn this into KIXTart code? [Re: Allen]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
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
_________________________
Actually I am a Rocket Scientist! \:D

Top
#210763 - 2015-09-30 01:25 PM Re: Can I turn this into KIXTart code? [Re: Glenn Barnas]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
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.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 381 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.057 seconds in which 0.024 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org