|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming | |
Variables in Batch/DOS file paths?
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | ||||||||||||
|
Folding Fanatic
![]() |
Yeah that's right, I'm still using DOS in this day and age.
Well, "still" isn't the right word, since I just started using it this morning. Before you recommend something else, I'm only using Batch because I knew a tiny bit about it and because it seemed to be the easiest way to manipulate files in Windows. So, without further ado, here's where I need help: Code:
COPY "C:\Users\%USERNAME%\Documents\VMC Themes\%THEME%.dll" "C:\Windows\ehome\ehres.dll" What's an easy way to get around using the variable in the path? I already tried setting another variable to the full path and using COPY THEPATH "C:\etcetc" Any other thoughts? Oh, by the way, after I get this working I'm going to try to redo it in other languages or at least make a GUI for it and make it an exe (which I have absolutely no experience with, but I'll figure it out). edit: if anybody knows the environment variable for the Documents folder in Vista, please let me know. I couldn't find it. edit again: the only way I've found for the Documents variable is in the key "HKEY_CURRENT_USER\Software\Microsoft\Windows\Curr entVersion\Explorer\Shell Folders String value: Personal" but I don't know how to set another variable to this value. I'm also running into another issue after I set the source folder to a constant: the destination of the file I'm copying, "C:\windows\ehome\ehres.dll," is protected by Windows Resource Protection. This is just getting more and more complicated... Even though I'm the admin, I can't drag-drop the file (even though I copied in ... What gives?! This is getting to be overly complicated...
__________________
Last edited by nategr8ns : 07-10-09 at 05:58 PM |
||||||||||||
|
|
|
|
|
#2 (permalink) | |||||||||||||
|
4.0ghz
![]() |
Just from looking a the few snippets you wrote seems to indicate you're "jumping in with both feet". Start slow.
Instead of using a variables, use the actual username/filename. When that works , switch to variables. Variables are defined with the "set" command. If I remember correctly, there's also a requirement to use double % signs when accessing variables????. You may find learning and using the FOR (for-in-do) command easier for accomplishing your task. As for avoiding Vista's security features, disable all you can.
__________________
EDGE ...if you're not on it, you're taking up too much space.
Last edited by billbartuska : 07-11-09 at 07:05 AM |
|||||||||||||
|
|
|
|
#3 (permalink) | |||||||||||||
|
Folding Fanatic
![]() |
Quote:
).
__________________
|
|||||||||||||
|
|
|
|
|
#4 (permalink) | ||||||||||||||
|
4.0ghz
![]() |
Quote:
Google will tell you how. It's the same idea, but a slightly different procedure for registry entries.
__________________
EDGE ...if you're not on it, you're taking up too much space.
|
||||||||||||||
|
|
|
|
#5 (permalink) | |||||||||||||
|
Folding Fanatic
![]() |
Quote:
![]() I still can't delete the file manually or overwrite it with my script. I'm not 100% sure how to change the ACL settings, so that's probably it.
__________________
Last edited by nategr8ns : 07-12-09 at 01:27 PM |
|||||||||||||
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|