Sign in to follow this  
Followers 0
Rex

How to do a subst, using AutoIT

15 posts in this topic

Hi i'm trying to recreate a login script.

Converting bat to autoit, but i have problem with the dos command subst, i can't finde any function in AutoIt thats "cloning" af folder to a drive(letter)

I do not wish to share the folder by network, there for i ude the subst command.

Any of u have a sugg.

/Rex

Share this post


Link to post
Share on other sites



Hi,

what do you mean? DirCopy?

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Hi,

what do you mean? DirCopy?

So long,

Mega

nope not dircopy, that would just copy the contains :-)

subst mounts a folder as a drive, this i a kinde of using net use (X: \\server\name\folder)

where subst don not need the computer to be connecet to a network... eg. subst X: "C:\Temp" would "map" the C:\Temp folder as drive X

/Rex

Share this post


Link to post
Share on other sites

$sDriveLetter ="Q:"
$sSubstPath = "C:\Temp"
Run(@ComSpec & " /c " & 'subst ' &$sDriveLetter &' ' &$sSubstPath , "", @SW_HIDE)


- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Share this post


Link to post
Share on other sites

$sDriveLetter ="Q:"
$sSubstPath = "C:\Temp"
Run(@ComSpec & " /c " & 'subst ' &$sDriveLetter &' ' &$sSubstPath , "", @SW_HIDE)
I would not use the comspec i i can avoide it (don't like to mix old style / newstyle) and there are to many var's to keep track of.. (the script checks the name of the user current login on, and then "clones"/substs the users special folder to a drive) But if the use have speciel car's in the name and the are not translated correctly or somhow the comspec don't regonice them, the script fails :-(

/Rex

Share this post


Link to post
Share on other sites

Run ("SUBST X: D:\HotQ","",@SW_Hide)
This alsow just starts the comspec, just a nother way :-(

/Rex

Share this post


Link to post
Share on other sites

I would not use the comspec i i can avoide it (don't like to mix old style / newstyle) and there are to many var's to keep track of.. (the script checks the name of the user current login on, and then "clones"/substs the users special folder to a drive) But if the use have speciel car's in the name and the are not translated correctly or somhow the comspec don't regonice them, the script fails :-(

/Rex

Surely then it is the job of your script to trap for special characters, why calling subst with the run command would cause issues with the amount of variables you need to keep track of. I'll pretty much guarantee that any other method is going to be harder and likely involve more variables than the methods already explained

Share this post


Link to post
Share on other sites

Surely then it is the job of your script to trap for special characters, why calling subst with the run command would cause issues with the amount of variables you need to keep track of. I'll pretty much guarantee that any other method is going to be harder and likely involve more variables than the methods already explained

Hmmm this is wher my poor english hits the wall, cource i did't mee var's like in $var but more like somthing out of my hands things, don't know how to say it...

In my language, we have som car's that the comspect cant handle except if the are in DOS txt style (can't rember what it's called) so when i want to use the letter "ø" i need to convert i to "" using ALT + 0155 (acsii), and still i can't get i to work thru autoit and comspect, using i i use bat there is no prob at all ???

But is't there a func in Autoit that works just like subst ??? see that would be a cool func....

/Rex

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

But is't there a func in Autoit that works just like subst ??? see that would be a cool func....

/Rex

No not a built in function.

Whatever you put in a bat file would be the same calling run("subst......")

Edited by ChrisL

Share this post


Link to post
Share on other sites

No not a built in function.

Whatever you put in a bat file would be the same calling run("subst......")

Cant get it to work :-(

Share this post


Link to post
Share on other sites

Ive just created a folder called FølR and this code works fine

Run ("SUBST X: D:\FølR","",@SW_Hide)

Damned now i know why the sh.. don't work for me.... i misspelled the folder name :whistle:

Jow it's working, thx

/Rex

Share this post


Link to post
Share on other sites

Hi i'm trying to recreate a login script.

Converting bat to autoit, but i have problem with the dos command subst, i can't finde any function in AutoIt thats "cloning" af folder to a drive(letter)

I do not wish to share the folder by network, there for i ude the subst command.

Any of u have a sugg.

/Rex

Look up DriveMapAdd(...)

Ralph

Share this post


Link to post
Share on other sites

Look up DriveMapAdd(...)

Ralph

That requiers a shared folder, and that is just wath i don't want

/Rex

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0