Jump to content

How do you include a variable into a network path?


Recommended Posts

Hi,

I am trying to include a variable into a network path that is declared in my script.

First an Input box appears and asks for a computer name

Then the file that needs to be accessed Uses this variable along with the rest of the path that is static.

$compname = InputBox("Computer Name", "Computer Name:", "", "")

If $compname = 1 Then

Exit

Else

$compname = 0

$file1 = "\\Need to Declare the variable Here\Folder_Name\Clean Install\Location.txt"

Thanks in advance

Mike

Link to comment
Share on other sites

Thanks for that...

There is a heap more code after this that relies on the If statement in the little snippet I posted.

Thanks for your heads up though...

Mike

$compname = InputBox("Computer Name", "Computer Name:")

$file1 = "\\" & $compname & "\Folder_Name\Clean Install\Location.txt"

...I am not sure why u had that if statement..

Link to comment
Share on other sites

Thanks for that...

There is a heap more code after this that relies on the If statement in the little snippet I posted.

Thanks for your heads up though...

Mike

What had confusedd me was that u set the variable $compname to 0 if it didnt equal one.... which perty much eliminated the purpose of the inputbox...

[sup]Psibernetic[/sup]My Creations:X-HideSecuracy

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...