Jump to content
Sign in to follow this  
Gino

Dos command with variable

Recommended Posts

Hi

I'm new to AutoIT and a friend tipt me about it.

My problem is that I want to do a "Windows" program for one in the office so I dont need to do all typing. We are moving about 600 people from one Novell tree to a new tree and when we copy the user files the ownership is set to admin. To fix this we need to type in a DOS windows as followd:

map r i:=\\cl_hem\hem\zzz\zzzyyyy

flag \*.* /s /name=.yyyy.zzz.fim.fack

map del i:

this is what to write for 600 people.

The girl in the office will help me if I can fix a "win" script with question boxes.

First a box that will ask for "zzz", second a box that will ask for "yyyy" then run the script. The "zzz" stands for department number and yyyy is the username.

Hope some one can help me.

/Gunnar

Share this post


Link to post
Share on other sites

hello, i alos had the same problem when i was making a script using cmd and need a variable, this is what my script used.

Run(@ComSpec & ' /c xcopy /e /h /y "' & $Folder1 & '" "' & $Folder2 & '"', "", @SW_HIDE)

as you can c i have 2 variables in there folder1 and folder 2, it runs in a hidden window to so u wont know its there :idiot:, the xcopy /e /h /y are just commands for the xcopy function, which is called by using /c, if u want to cal and external program u must use /c then the program , then its functions, hope that helps :D


qq

Share this post


Link to post
Share on other sites

Hi

I'm new to AutoIT and a friend tipt me about it.

My problem is that I want to do a "Windows" program for one in the office so I dont need to do all typing. We are moving about 600 people from one Novell tree to a new tree and when we copy the user files the ownership is set to admin. To fix this we need to type in a DOS windows as followd:

map r i:=\\cl_hem\hem\zzz\zzzyyyy

flag \*.* /s /name=.yyyy.zzz.fim.fack

map del i:

this is what to write for 600 people.

The girl in the office will help me if I can fix a "win" script with question boxes.

First a box that will ask for "zzz", second a box that will ask for "yyyy" then run the script. The "zzz" stands for department number and yyyy is the username.

Hope some one can help me.

/Gunnar

<{POST_SNAPBACK}>

Gino/Gunnar, there's got to be a better solution that what you've got. Have you looked at the NetWare cool solutions site for anything that might help with this?

If not, the place where AutoIt could help with this would be making an AutoIt script that let you authenticate to NetWare as a user with supervisor permission for performing the ownership change for the files, then compiling the AutoIt script into an EXE which could be run from each user's NetWare login script. The login script would have both the username and maybe the department #, I guess, as an NDS Group? That way the permission change would run for each user at login time, on demand.


Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Share this post


Link to post
Share on other sites

Gino, welcome to the forum. Try the follow code, it might help to get you started:

$zzz = InputBox("zzz", "Enter Department Number:")
$yyyy = InputBox("yyyy", "Enter User Name:")

RunWait(@ComSpec & " /c " & 'map r i:=\\cl_hem\hem\' & $zzz & '\' & $zzz & $yyyy & '', "", @SW_HIDE)
RunWait(@ComSpec & " /c " & 'flag \*.* /s /name=.' & $yyyy & '.' & $zzz & '.fim.fack', "", @SW_HIDE)
RunWiat(@ComSpec & " /c " & 'map del i:', "", @SW_HIDE)

MsgBox(0, "zzz & yyyy", "Script Complete!")

This code is not tested, so don't expect it to work correctly. But the concept should be sound.

Also, check the Help File for InputBox(), and Run(), and RunWait(). Those commands should be what you need.

Hope this helps,

Ian


"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post


Link to post
Share on other sites

A while since I've used Netware, but I seem to recall that I usually migrated server disks by xcopying, and then running a little utility that backed-up the security info on the source disk. It created a batch-file which, if run on the destination disk, put the security-info back. Can't remember its name, but it should be on the Novell site I should think.

Might be of help here, anyway.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...