Jump to content

How to do a subst, using AutoIT


Recommended Posts

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

Link to comment
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

Link to comment
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

Link to comment
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]

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...